data() {
return {
oldMobile:"",
flag:1,
time:60,
codeText:‘获取验证码’
}
},
// 倒计时方法
countDown() {
let that = this
this.time = this.time - 1;
console.log( this.time)
this.codeText = this.time+“秒后重新发送”
if (this.time== 0) {
this.codeText = “重新发送”
this.flag = 1;
this.time = 60;
return;
}
setTimeout(function(){
that.countDown()
},1000);
},