Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
669 views
in Technique[技术] by (71.8m points)

Vue使用onDownloadProgress实现进度条计算的数字太快el-progress的color渲染跟不上。

 <el-progress type="dashboard"  :percentage="this.complete" :color="colors"></el-progress>
 onDownloadProgress :progress=>{
            //这里的complete 加载进度的数字
            let complete = (Math.round(progress.loaded / progress.total * 100));
            this.tips="正在下载···"
            if(complete>98){
              this.tips="资源获取完毕,解析中···"
              //this.colors = '#1989fa'
            }
            if(complete==100){
              complete=99
              //this.colors = '#1989fa'
            }
            this.complete = complete
            console.log(this.complete)
          },

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神解答

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...