let timer_this = this; function changeSendBtn () { if (sendTime<0){ console.log('清除定時(shí)器'); timer_this.sendBtnTitle = '發(fā)送驗(yàn)證碼'; clearInterval(timer_this.sendBtnTimer); return false; } timer_this.sendBtnTitle = sendTime+'s'; sendTime--; console.log(sendTime) } this.sendBtnTimer = setInterval(changeSendBtn(),1000);寫了一個(gè)定時(shí)器,但是只運(yùn)行一次,高手們幫我看下原因所在
vue下循環(huán)定時(shí)器只運(yùn)行了一次的問題
眼眸繁星
2018-12-12 18:19:45