定时器
mounted() {
this.getData()
const _this = this
this.upData = setInterval(() => {
_this.getData()
}, parseInt(30 * 1000))
},
//清除
beforeDestroy() {
if (this.upData) {
clearInterval(this.upData)
}
},
vue & 定时器
阅读 66
2022-01-21
mounted() {
this.getData()
const _this = this
this.upData = setInterval(() => {
_this.getData()
}, parseInt(30 * 1000))
},
//清除
beforeDestroy() {
if (this.upData) {
clearInterval(this.upData)
}
},
相关推荐
精彩评论(0)