Tohold

vue60秒倒计时

 

wait:"60",
content:"验证码",
canClick: true,

 

 

 

daojishi(){
if(!this.canClick) return
this.canClick = false
this.content = this.wait + \'秒\' //这里解决60秒不见了的问题
let clock = window.setInterval(() => {
this.wait--
this.content = this.wait + \'秒\'
if (this.wait < 0) { //当倒计时小于0时清除定时器
window.clearInterval(clock)
this.content = \'验证码\'
this.wait = 60
this.canClick = true
}
},1000)

},

 

分类:

技术点:

相关文章:

  • 2021-12-14
  • 2021-12-25
  • 2021-10-18
  • 2021-10-28
  • 2021-12-23
  • 2021-11-17
  • 2022-02-07
猜你喜欢
  • 2021-10-06
  • 2021-12-23
  • 2021-12-23
  • 2021-12-21
  • 2021-12-14
  • 2022-12-23
相关资源
相似解决方案