Vue前端定时器
Vue中非常实用简单的 前端定时器
js中:
data: {
timer: '',
},
methods : {
//定时器:5秒
timerSetInterval:function (){
//循环定时器
this.timer = setInterval(this.getAllValue, 5000);
},
//销毁定时器
beforeDestroy:function() {
clearInterval(this.timer);
},
}
..
原创
2021-04-25 18:34:17 ·
811 阅读 ·
0 评论