methods:{
    timeToRefresh(){
	this.timer = setInterval(()=>{
	    // 调用的方法
	},1000)
    }
},
// 清除定时器
beforeDestroy(){
    clearInterval(this.timer)
    this.timer = null
}

相关文章:

  • 2022-12-23
  • 2021-11-06
  • 2021-12-31
  • 2022-03-06
  • 2022-12-23
  • 2022-12-23
  • 2023-03-19
  • 2021-12-18
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-13
  • 2022-02-23
  • 2022-01-07
  • 2022-01-17
相关资源
相似解决方案