验证码倒计时

    getAuthCode(){
      if (!this.disabledBtn) {
        this.disabledBtn = true;
        let n = 3;
        let time = setInterval(()=> {
          var str = '(' + n + ')' + '重新获取';
          this.authCodeText = str;
          if (n <= 0) {
            this.authCodeText = '重新获取';
            this.disabledBtn = false;
            clearInterval(time);
          }
          n--;
        }, 1000);
      }
    },

  

posted @ 2020-05-22 20:08  LaLaLa_heng  阅读(148)  评论(0编辑  收藏  举报