Skip to content
# t-gap

Gap 间隔

t-gap 组件介绍 ​

间隔槽组件,提供空白区域,帮助内容元素更好地对齐和分布,用于在页面中创建视觉间隔。

t-gap 平台兼容 ​

HarmonyH5AndroidiOS小程序UTS
✅✅✅✅✅✅

t-gap 基础用法 ​

基础用法参考 demo/gap/gap.uvue,通过 type、effect 属性设置间隔样式。

vue
<template>
	<view class="p-15">
		<t-card class="mb-15" title='' sub-title="提供空白区域,帮助内容元素更好地对齐和分布。"></t-card>
		<t-section class="mb-15" title="基础功能-type"></t-section>
		<t-gap class="mb-15"></t-gap>
		<t-gap class="mb-15" type="primary"></t-gap>
		<t-gap class="mb-15" type="success"></t-gap>
		<t-gap class="mb-15" type="info"></t-gap>
		<t-gap class="mb-15" type="warning"></t-gap>
		<t-gap class="mb-15" type="error"></t-gap>
		<t-section class="mb-15" title="基础功能-effect"></t-section>
		<t-gap class="mb-15" effect="normal" type="primary"></t-gap>
		<t-gap class="mb-15" effect="dark" type="primary"></t-gap>
		<t-gap class="mb-15" effect="normal" type="primary"></t-gap>
		<t-gap class="mb-15" effect="light" type="primary"></t-gap>
		<t-gap class="mb-15" effect="plain" type="primary"></t-gap>
		<t-section class="mb-15" title="自定义颜色"></t-section>
		<t-gap class='bg-#0055ff mb-15'></t-gap>
		<t-section class="mb-15" title="设置宽高"></t-section>
		<t-gap class="h-25 mb-15" type="primary"></t-gap>
		<t-section class="mb-15" title="设置上下边距"></t-section>
		<t-gap class="mb-15"></t-gap>
	</view>
</template>

t-gap Props ​

属性名类型默认值说明可选值
sizeString"medium"组件尺寸large, medium, small, mini
typeString""组件类型info, primary, error, warning, success
disabledBooleanfalse组件是否禁用true, false
hoverBooleanfalse是否有点击效果true, false
pathString""点击组件后跳转的页面路径-
effectString"normal"组件显示主题normal, dark, light, plain

t-gap Events ​

事件名说明回调参数
click点击时触发-
transitionend动画结束时触发-
initFinished组件初始化完成触发组件的节点信息
touchstart触摸开始时触发触摸事件对象
touchend触摸结束时触发触摸事件对象
touchmove触摸移动时触发触摸事件对象
touchcancel触摸取消时触发触摸事件对象

t-gap Slots ​

插槽名说明
default自定义内容插槽