data() {
return {
timer: null
}
},
mounted() {
// 每隔5分钟定时刷新
this.timer = setInterval(() => {
this.getFxItemlist();
}, 300000)
},
beforeDestroy() {
clearInterval(this.timer);
},
methods: {
getFxItemlist() {
...
}
}
vue定时刷新数据,每隔5分钟执行一次
最新推荐文章于 2024-07-15 10:51:49 发布