icon
Icon
Attribute Name | Type | Default | Description | Minimum Version |
type | String | icon type, effective value: info, warn, waiting, cancel, download, search, clear, success, success_no_circle,loading | ||
size | Number | 23 | icon size, in px | |
color | Color | icon color, same as css color |
Screenshot
Sample Code
copy
<block a:for="{{iconType}}">
<view class="item">
<icon type="{{item}}" aria-label="{{item}}" size="45"/>
<text>{{item}}</text>
</view>
</block>
<block a:for="{{iconSize}}">
<view class="item">
<icon type="success" size="{{item}}"/>
<text>{{item}}</text>
</view>
</block>
<block a:for="{{iconColor}}">
<view class="item">
<icon type="success" size="45" color="{{item}}"/>
<text style="color:{{item}}">{{item}}</text>
</view>
</block>
copy
Page({
data: {
iconSize: [20, 30, 40, 50, 60],
iconColor: [
'red', 'yellow', 'blue', 'green'
],
iconType: [
'success',
'info',
'warn',
'waiting',
'clear',
'success_no_circle',
'download',
'cancel',
'search',
]
}
})