定时调用getAllData方法
data() {
return {
timer: null,
}
},
beforeDestyroyed() {
clearInterval(this.timer)
this.timer = null
},
},
mounted() {
this.getAllData()
this.timer = setInterval(() => {
this.getAllData()
}, 1000)
},
定时获取数据的Vue组件
1999

被折叠的 条评论
为什么被折叠?



