W3Cschool
恭喜您成為首批注冊(cè)用戶
獲得88經(jīng)驗(yàn)值獎(jiǎng)勵(lì)
突出利益點(diǎn)、以及屬性說(shuō)明的標(biāo)簽。
{
"defaultTitle": "Tag",
"usingComponents": {
"tag": "mini-ali-ui/es/tag/index",
"list-item": "mini-ali-ui/es/list/list-item/index",
"am-switch": "mini-ali-ui/es/am-switch/index"
}
}
<view style="padding: 12px;">
<view style="display: flex; justify-content: space-evenly;">
<tag size="lg" iconType="{{useIcon ? 'qr' : ''}}" ghost="{{ghost}}" type="primary">標(biāo)簽</tag>
<tag size="lg" iconType="{{useIcon ? 'qr' : ''}}" ghost="{{ghost}}" type="warning">標(biāo)簽</tag>
<tag size="lg" iconType="{{useIcon ? 'qr' : ''}}" ghost="{{ghost}}" type="danger">標(biāo)簽</tag>
<tag size="lg" iconType="{{useIcon ? 'qr' : ''}}" ghost="{{ghost}}" type="success">標(biāo)簽</tag>
</view>
<view style="display: flex; justify-content: space-evenly; margin-top: 20px;">
<tag size="sm" iconType="{{useIcon ? 'qr' : ''}}" ghost="{{ghost}}" type="primary">標(biāo)簽</tag>
<tag size="sm" iconType="{{useIcon ? 'qr' : ''}}" ghost="{{ghost}}" type="warning">標(biāo)簽</tag>
<tag size="sm" iconType="{{useIcon ? 'qr' : ''}}" ghost="{{ghost}}" type="danger">標(biāo)簽</tag>
<tag size="sm" iconType="{{useIcon ? 'qr' : ''}}" ghost="{{ghost}}" type="success">標(biāo)簽</tag>
</view>
<view style="padding: 20px 10px;">
<list-item>
圖標(biāo)
<am-switch slot="extra" onChange="setInfo" data-name="useIcon" checked="{{useIcon}}"/>
</list-item>
<list-item>
線框樣式
<am-switch slot="extra" onChange="setInfo" data-name="ghost" checked="{{ghost}}"/>
</list-item>
</view>
</view>
Page({
data: {},
onLoad() {},
setInfo(e) {
const { dataset } = e.target;
const { name } = dataset;
this.setData({
[name]: e.detail.value,
});
},
});
屬性 | 類(lèi)型 | 默認(rèn)值 | 描述 |
---|---|---|---|
className | String | - | 類(lèi)名稱(chēng)。 |
type | String | primary | 標(biāo)簽類(lèi)型??蛇x值:primary、success、warning、danger。 |
iconType | String | - | 圖標(biāo)類(lèi)型。 |
size | String | lg | 標(biāo)簽大小??蛇x值:lg、sm。 |
ghost | Boolean | false | 是否顯示為線框的 tag 樣式??蛇x值:true、false。 |
slotName | 描述 |
---|---|
- | 標(biāo)簽內(nèi)部文案。 |
Copyright©2021 w3cschool編程獅|閩ICP備15016281號(hào)-3|閩公網(wǎng)安備35020302033924號(hào)
違法和不良信息舉報(bào)電話:173-0602-2364|舉報(bào)郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號(hào)
聯(lián)系方式:
更多建議: