let timer_this = this;
function changeSendBtn () {
if (sendTime<0){
console.log('清除定时器');
timer_this.sendBtnTitle = '发送验证码';
clearInterval(timer_this.sendBtnTimer);
return false;
}
timer_this.sendBtnTitle = sendTime+'s';
sendTime--;
console.log(sendTime)
}
this.sendBtnTimer = setInterval(changeSendBtn(),1000);
写了一个定时器,但是只运行一次,高手们帮我看下原因所在
忽然笑
相关分类