<template>
<div class="progerss-box" show="{
{ showLoading }}">
<progress class="progerss" percent="{
{ progress }}"></progress>
</div>
</template>
<script>
export default {
data: {
showLoading: true,
progress: 0,
number: 0,
falg: false,
},
loadpageControl() {
const self = this
this.loadTimer = setInterval(() => {
if (self.progress < 90)
self.progress += 1
}, 10)
setTimeout(()=>{
self.finish()
},4000)
},
// 加载前
start() {
this.showLoading = true
this.progress = 0
clearInterval(this.loadTimer)
this.loadpageControl()
},
// 加载完成
finish(callback) {
if (this.falg) return
this.falg = true
const self = this
clearInterval(this.loadTimer)
// let length = 100-self.progress
// let time = Math.floor(400
快应用加载进度条
最新推荐文章于 2022-09-28 16:00:29 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)