小程式學習02->icon圖示與progress進度條
阿新 • • 發佈:2018-12-15
一、icon
icon為顯示圖示的元件,其屬性如下所示:
.wxml檔案
<view class="group">
<block wx:for="{{iconSize}}">
<icon type="success" size="{{item}}"></icon>
</block>
</view>
<view class="group">
<block wx:for="{{iconType}}">
<icon type ="{{item}}" size="45"></icon>
</block>
</view>
<view>
<block wx:for="{{iconColor}}">
<icon type="success" size="60" color="{{item}}"></icon>
</block>
</view>
.js檔案
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',
'search','cancel'
],
},
效果圖:
二、progress
progress屬性如下圖所示:
.wxml檔案
<progress percent="40" show-info="true"/>
<progress percent ="30" stroke-width="100"/>
<progress percent="50" color="#ff0000"/>
<progress percent="70" active/>
效果圖: