data: {
    return {
        timer: null
    }
},
created() {
    this.timer = setInterval(....);
},
beforeDestroy() {
    if(this.timer) { //如果定时器还在运行 或者直接关闭,不用判断
        clearInterval(this.timer); //关闭
    }
}

相关文章:

  • 2021-12-31
  • 2021-12-31
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-12-31
  • 2022-12-23
  • 2022-12-23
  • 2021-10-29
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案