W3Cschool
恭喜您成為首批注冊用戶
獲得88經驗值獎勵
突出利益點、以及屬性說明的標簽。
{
"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">標簽</tag>
<tag size="lg" iconType="{{useIcon ? 'qr' : ''}}" ghost="{{ghost}}" type="warning">標簽</tag>
<tag size="lg" iconType="{{useIcon ? 'qr' : ''}}" ghost="{{ghost}}" type="danger">標簽</tag>
<tag size="lg" iconType="{{useIcon ? 'qr' : ''}}" ghost="{{ghost}}" type="success">標簽</tag>
</view>
<view style="display: flex; justify-content: space-evenly; margin-top: 20px;">
<tag size="sm" iconType="{{useIcon ? 'qr' : ''}}" ghost="{{ghost}}" type="primary">標簽</tag>
<tag size="sm" iconType="{{useIcon ? 'qr' : ''}}" ghost="{{ghost}}" type="warning">標簽</tag>
<tag size="sm" iconType="{{useIcon ? 'qr' : ''}}" ghost="{{ghost}}" type="danger">標簽</tag>
<tag size="sm" iconType="{{useIcon ? 'qr' : ''}}" ghost="{{ghost}}" type="success">標簽</tag>
</view>
<view style="padding: 20px 10px;">
<list-item>
圖標
<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,
});
},
});
屬性 | 類型 | 默認值 | 描述 |
---|---|---|---|
className | String | - | 類名稱。 |
type | String | primary | 標簽類型??蛇x值:primary、success、warning、danger。 |
iconType | String | - | 圖標類型。 |
size | String | lg | 標簽大小??蛇x值:lg、sm。 |
ghost | Boolean | false | 是否顯示為線框的 tag 樣式。可選值:true、false。 |
slotName | 描述 |
---|---|
- | 標簽內部文案。 |
Copyright©2021 w3cschool編程獅|閩ICP備15016281號-3|閩公網安備35020302033924號
違法和不良信息舉報電話:173-0602-2364|舉報郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號
聯(lián)系方式:
更多建議: