![在这里插入图片描述](https://img-blog.csdnimg.cn/direct/da8b7ad52b6b45f9b64f107304f2bf4b.png)
html部分
<div class="scoreWapper">
<div class="scoreSlider">
<div class="scoreSliderBar" :style="'width:'+scoreNum+'%'"></div>
</div>
<div class="scoreWapperList">加载中({{scoreNum}}%)</div>
</div>
css部分
.scoreWapper{
width: 80%;
.scoreSlider{
width: 100%;
height:10px;
background-color:rgba(255, 255, 255, 0.3);
border-radius: 20px;
.scoreSliderBar{
height:10px;
background-color:rgba(255, 255, 255,1);
border-radius: 20px;
}
}
.scoreWapperList{
margin-top:10px;
font-size: 13px;
color:#fff;
}
}
js 部分
methods: {
//加载速度
getLoading(){
let totla=0;
let timer=setInterval(()=>{
totla++;
if (t < 101) {
this.scoreNum=totla
}
// if (totla == 100) console.log("已到最大长度:清除定时器");
if (totla == 100) {
clearInterval(timer)
}
},100)
},
}