首页 > 其他 > 详细

定时器

时间:2019-10-24 15:02:07      阅读:76      评论:0      收藏:0      [点我收藏+]
  onLoad: function(opt) {
    let that = this;
    let n = this.data.n;
    function nowTime() {
      n++;
      console.log(n)
      if (timer) {}
      if (n > 5 && timer) {
        clearInterval(timer);
      }
    }
    var timer = setInterval(nowTime, 2000);

  },

 

定时器

原文:https://www.cnblogs.com/dianzan/p/11731802.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!