this.$once('hook:beforeDestroy', ()=>{}) clear timer

mounted() {
    
    
  this.timer = setInterval(() => {
    
    
    this.checkPoliceSituationDisposal()
  }, 60 * 1000)
  this.$once('hook:beforeDestroy', () => {
    
    
    clearInterval(this.timer)
    this.timer = null
  })
},

Guess you like

Origin blog.csdn.net/m0_53562074/article/details/130729435