定时器
mounted() {
this.getData()
const _this = this
this.upData = setInterval(() => {
_this.getData()
}, parseInt(30 * 1000))
},
//清除
beforeDestroy() {
if (this.upData) {
clearInterval(this.upData)
}
},
微信扫一扫
mounted() {
this.getData()
const _this = this
this.upData = setInterval(() => {
_this.getData()
}, parseInt(30 * 1000))
},
//清除
beforeDestroy() {
if (this.upData) {
clearInterval(this.upData)
}
},
相关推荐