其他分享
首页 > 其他分享> > vue实现按钮倒计时失效

vue实现按钮倒计时失效

作者:互联网

let sj = setInterval(() => {
        this.time--  //初始时间为10秒
        this.msg = this.time + '后再操作'    //按钮提示文字
        this.flag = true   //设置按钮失效
        if (this.time == 0) {
          clearInterval(sj)
          this.time = 10
          this.msg = '发送验证码'
          this.flag = false
        }
      },1000)

 

标签:10,vue,按钮,倒计时,sj,flag,time,msg
来源: https://www.cnblogs.com/ztlman/p/15801605.html