# t-gap
Gap 间隔
t-gap 组件介绍
间隔槽组件,提供空白区域,帮助内容元素更好地对齐和分布,用于在页面中创建视觉间隔。
t-gap 平台兼容
| Harmony | H5 | Android | iOS | 小程序 | 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
| 属性名 | 类型 | 默认值 | 说明 | 可选值 |
|---|---|---|---|---|
| size | String | "medium" | 组件尺寸 | large, medium, small, mini |
| type | String | "" | 组件类型 | info, primary, error, warning, success |
| disabled | Boolean | false | 组件是否禁用 | true, false |
| hover | Boolean | false | 是否有点击效果 | true, false |
| path | String | "" | 点击组件后跳转的页面路径 | - |
| effect | String | "normal" | 组件显示主题 | normal, dark, light, plain |
t-gap Events
| 事件名 | 说明 | 回调参数 |
|---|---|---|
| click | 点击时触发 | - |
| transitionend | 动画结束时触发 | - |
| initFinished | 组件初始化完成触发 | 组件的节点信息 |
| touchstart | 触摸开始时触发 | 触摸事件对象 |
| touchend | 触摸结束时触发 | 触摸事件对象 |
| touchmove | 触摸移动时触发 | 触摸事件对象 |
| touchcancel | 触摸取消时触发 | 触摸事件对象 |
t-gap Slots
| 插槽名 | 说明 |
|---|---|
| default | 自定义内容插槽 |