vue中使用定时器setInterval
this.timer = setInterval(this.fetchData, 1000);
clearInterval(this.timer);
beforeDestroy() {
clearInterval(this.timer);
},
vue中使用定时器setInterval
this.timer = setInterval(this.fetchData, 1000);
clearInterval(this.timer);
beforeDestroy() {
clearInterval(this.timer);
},