0
点赞
收藏
分享

微信扫一扫

vue & 定时器

全栈学习笔记 2022-01-21 阅读 63

定时器

mounted() {

  this.getData()

  const _this = this

  this.upData = setInterval(() => {

   _this.getData()

  }, parseInt(30 * 1000))

 },
//清除
 beforeDestroy() {

  if (this.upData) {

   clearInterval(this.upData)

  }

 },
举报

相关推荐

0 条评论