微信小程序内容组件图标 icon

上传时间:2018-03-10阅读数:3839

icon


图标。

属性名类型默认值说明
typeString icon的类型,有效值:success, success_no_circle, info, warn, waiting, cancel, download, search, clear
sizeNumber23icon的大小,单位px
colorColor icon的颜色,同css的color

示例:

代码片段


<view class="group">
  <block wx:for="{{iconSize}}">
    <icon type="success" size="{{item}}"/>
  </block>
</view>

<view class="group">
  <block wx:for="{{iconType}}">
    <icon type="{{item}}" size="40"/>
  </block>
</view>


<view class="group">
  <block wx:for="{{iconColor}}">
    <icon type="success" size="40" color="{{item}}"/>
  </block>
</view>
Page({
  data: {
    iconSize: [20, 30, 40, 50, 60, 70],
    iconColor: [
      'red', 'orange', 'yellow', 'green', 'rgb(0,255,255)', 'blue', 'purple'
    ],
    iconType: [
      'success', 'success_no_circle', 'info', 'warn', 'waiting', 'cancel', 'download', 'search', 'clear'
    ]
  }
})

icon




目录