微信小程序组件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