# tui-label 标签 会员组件
介绍
用来改进表单组件的可用性,将控件放在该标签下,当点击时,就会触发对应的控件。目前可以绑定的控件有:tui-checkbox, tui-radio, tui-switch。
# 引入
# uni-app引入
第一种,手动引入(可全局引入)
import tuiLabel from "@/components/thorui/tui-label/tui-label.vue"
export default {
components:{
tuiLabel
}
}
第二种,开启easycom组件模式,如果不了解如何配置,可先查看 官网文档 (opens new window)。
# uni-app版本平台差异说明
App-Nvue | App-vue | H5 | 微信小程序 | 支付宝小程序 | 百度小程序 | 字节小程序 | QQ小程序 |
---|---|---|---|---|---|---|---|
升级中 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
# 微信小程序引入(可在app.json中全局引入)
{
"usingComponents": {
"tui-label": "/components/thorui/tui-label/tui-label"
}
}
# 代码演示
部分功能演示,具体可参考示例程序以及文档API。
switch
<tui-label>
<tui-list-cell>
<view class="thorui-flex__between">
<text>ON/OFF</text>
<tui-switch></tui-switch>
</view>
</tui-list-cell>
</tui-label>
# Slots
插槽名称 | 说明 |
---|---|
default | 标签显示内容,将控件放在该标签下 |
# Props
属性名 | 类型 | 说明 | 默认值 |
---|---|---|---|
padding | String | padding值 | 0 |
margin | String | margin值 | 0 |
isFull | Boolean | 是否铺满 ,即宽度100% | false |
# Events
事件名 | 说明 | 回调参数 |
---|---|---|
- | - | - |
# 预览
请以移动端效果为准,touch事件目前尚未在PC端做兼容。
# 特别说明
该组件为 会员组件
,非开源内容,需开通会员才可获取使用。
# 线上程序扫码预览
![]() | ![]() | ![]() |
---|---|---|
ThorUI组件库小程序码 | H5二维码 | ThorUI示例小程序码 |