let timer = setInterval(() => {
this.getUserAccountList()
}, 10 * 1000)
this.$once('hook:beforeDestroy', () => {
clearInterval(timer)
timer = null
})
在Vue中amounted设置单页面的刷新,离开该页面停止自动刷新。
阅读 63
2023-03-06
let timer = setInterval(() => {
this.getUserAccountList()
}, 10 * 1000)
this.$once('hook:beforeDestroy', () => {
clearInterval(timer)
timer = null
})
相关推荐
精彩评论(0)