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);寫了一個定時器,但是只運行一次,高手們幫我看下原因所在
vue下循環定時器只運行了一次的問題
眼眸繁星
2018-12-12 18:19:45