清除定时器 延时器
mounted 中 写下延时器
mounted() {
this.timer = setTimeout(() => {
this.$router.push('/login')
}, 3000)
},
清除定时器 beforeDestroy
如果 引入了以下:
代码:
import { clearTimeout } from 'timers'
需要 添加 window 才能找到 clearTimeout
beforeDestroy() {
win
原创
2020-05-22 16:13:06 ·
3042 阅读 ·
0 评论