# Gap 间隔槽
该组件一般用于内容块之间的用一个灰色块隔开的场景,方便用户风格统一,减少工作量
# 平台差异说明
App | H5 | 微信小程序 | 支付宝小程序 | 百度小程序 | 头条小程序 | QQ小程序 |
---|---|---|---|---|---|---|
√ | √ | √ | √ | √ | √ | √ |
# 基本使用
直接引入即可使用
- 通过
height
配置高度,单位rpx - 通过
bg-color
配置背景颜色 - 通过
theme
配置关怀模式,normal/careFPI - 通过
type
配置背景颜色类型,优先级低于bg-color
FPI
警告
FPI
当使用了bg-color
后,theme
关怀模式将失效,所以不建议使用bg-color
,毕竟也不符合 FPI-UI 的规范。
<template>
<view class="">
<u-gap :theme="theme" :type="type" :height="height" :margin-top="marginTop" :margin-bottom="marginBottom"></u-gap>
</view>
</template>
<script>
export default {
data() {
return {
theme: 'normal',
type: 'default',
height: 30,
marginTop: 30,
marginBottom: 30
};
}
};
</script>
# API
# Props
参数 | 说明 | 类型 | 默认值 | 可选值 |
---|---|---|---|---|
theme FPI | 主题模式,普通模式normal ,关怀模式care | String | normal | care |
bg-color | 背景颜色 | String | transparent(背景透明) | - |
type FPI | 背景颜色类型,优先级低于bg-color | String | default | primary/default/error/warning/success |
height | 间隔槽高度,单位rpx | String | Number | 30 | - |
margin-top | 与前一个元素的距离,单位rpx | String | Number | 0 | - |
margin-bottom | 与后一个元素的距离,单位rpx | String | Number | 0 | - |