You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
5 years ago | |
|---|---|---|
| .. | ||
| components/uni-tag | 5 years ago | |
| changelog.md | 5 years ago | |
| package.json | 5 years ago | |
| readme.md | 5 years ago | |
readme.md
Tag 标签
代码块:
uTag
用于展示1个或多个文字标签,可点击切换选中、不选中的状态 。
安装方式
本组件符合easycom规范,HBuilderX 2.5.5起,只需将本组件导入项目,在页面template中即可直接使用,无需在页面中import和注册components。
如需通过npm方式使用uni-ui组件,另见文档:https://ext.dcloud.net.cn/plugin?id=55
基本用法
在 template 中使用组件
<uni-tag text="标签"></uni-tag>
<uni-tag text="标签" type="error" :circle="true"></uni-tag>
<uni-tag text="标签" @click="bindClick"></uni-tag>
API
Tag Props
| 属性名 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| text | String | - | 标签内容 |
| size | String | normal | 大小尺寸,可选值:normal、small |
| type | String | default | 颜色类型,可选值:default(灰色)、primary(蓝色)、success(绿色)、warning(黄色)、error(红色)、royal(紫色) |
| disabled | Boolean | false | 是否为禁用状态 |
| inverted | Boolean | false | 是否无需背景颜色(空心标签) |
| circle | Boolean | false | 是否为圆角 |
Tag Events
| 事件称名 | 说明 | 返回值 |
|---|---|---|
| @click | 点击 Tag 触发事件 | - |