if (this.curPageUrl && this.curPageUrl != this.$route.path) {
return false;
}
// console.log("restimedRefresh",response.data.timedRefresh)
if (response.data.timedRefresh==true) {
this.realRefresh =setTimeout(()=>{
this.getmanualWelding()
},5000)
}
清除
// 销毁定时器清除setTimeout
beforeDestroy() {
this.curPageUrl = "end";
clearTimeout(this.realRefresh);
},
unmounted(){
clearInterval(this.timer)
},
mounted() {
this.getruncar()
this.timer =setInterval(() => {
if (document.getElementById('mainDiv')) {
this.getruncar()
}
}, 1000)
}