vue页面一段时间自动刷新

this.mounted=function(){
// 需要在一开始调用一下方法,否则在开始的30s是没有数据的
this.getAppListTableData();
if (this.timer) {
clearInterval(this.timer)
} else {
this.timer = setInterval(() => {
this.getAppListTableData();
}, 30000)
}
},
this.destroyed=function(){
clearInterval(this.timer);
},

 

posted @ 2020-08-27 11:10  free_upup  阅读(653)  评论(0)    收藏  举报