微信小程序組件progress


基礎內容progress:官方文檔

 

Demo Code:

Page({
  data:{
    percent:0
  },
  onReady:function(){
    this.percentAdd();
  },
  percentAdd:function(e){
    var that=this;
    setInterval(function(){
      var cur=that.data.percent;
      cur++;
      if(cur==101){
        cur=0;
      }
      that.setData({
        percent:cur
      });

    },100);    
  }
})
JS
<progress percent="20" show-info />
<progress percent="40" stroke-width="12" />
<progress percent="60" color="pink" />
<progress percent="80" active />
<progress percent="{{percent}}" />
WXML
progress{
    margin-top: 20px;
    margin-left: 5px;
    margin-right: 5px;
}
WXSS

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM