进度条
<el-button @click="init">进度</el-button>
<el-button @click="delteInit">清空</el-button>
<el-progress :text-inside="true" :stroke-width="22" :percentage="data" status="warning"></el-progress>
<script>
export default {
data () {
return {
data: 0,
time: null
}
},
methods: {
init () {
let i = 1
this.time = setInterval(() => {
i++
if (i >= 100) {
clearInterval(this.time)
}
console.log(i)
this.data = i
}, 500)
},
delteInit () {
this.data = 0
}
}
}
</script>