不需要这个加载组件,你们把这些全部去掉console.log()打印就可以了。
<style>
/*加载*/
.loader {
position: absolute;
left: 45%;
top: 40%;
z-index: 12;
}
</style>
<template>
<div>
<!--加载-->
<mu-circular-progress :size="40" color="#1da7eb" v-show="isLoader" class="loader"/>
</div>
</template>
<script>
export default {
data() {
return {
// 加载
isLoader: true
}
},
created() {
this.test()
},
methods: {
sleep(d) {
return new Promise((resolve) => setTimeout(resolve, d))
},
async test() {
this.$toast.show('正在自动登录')
// console.log('1111')
await this.sleep(1800)
this.$toast.show('登录成功')
// console.log('2222')
await this.sleep(1800)
this.isLoader = false
}
}
}
</script>