1、要求
做一个验证码的60s倒计时
2、上代码
//this.toWaiting = false;代表倒计时开始
this.toWaiting = false;
this.number = "60";
var timetimer = setInterval(() => {
this.number--;
if (this.number <= 0) {
this.toWaiting = true;
clearInterval(timetimer);
}
}, 1000);