js 递归验证码倒计时
// 递归60秒倒计时 tapCode() { // 递归60秒倒计时 let promise = new Promise((resolve, reject) => { let setTimer = setInterval( () => { this.setData({ time: this.data.time - 1 }) if (this.data.time <= 0) { this.setData({ time: 60 }) resolve(setTimer) } }, 1000) }) promise.then((setTimer) => { clearInterval(setTimer) }) },
561 Views