vue & 定时器

阅读 68

2022-01-21

定时器

mounted() {

  this.getData()

  const _this = this

  this.upData = setInterval(() => {

   _this.getData()

  }, parseInt(30 * 1000))

 },
//清除
 beforeDestroy() {

  if (this.upData) {

   clearInterval(this.upData)

  }

 },

相关推荐

精彩评论(0)

0 0 举报