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)

},
原文地址:https://www.cnblogs.com/Tohold/p/8929686.html