mounted() { if (this.timer) { clearInterval(this.timer) } else { this.timer = setInterval(() => { console.log('5S刷新一次数据') }, 5000) } }, destroyed() { clearInterval(this.timer) },
转载于:https://my.oschina.net/uwith/blog/3032578
mounted() { if (this.timer) { clearInterval(this.timer) } else { this.timer = setInterval(() => { console.log('5S刷新一次数据') }, 5000) } }, destroyed() { clearInterval(this.timer) },
转载于:https://my.oschina.net/uwith/blog/3032578