清除setTimeout定时器


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);
        },

你可能感兴趣的:(java,javascript,前端)