共计 236 个字符,预计需要花费 1 分钟才能阅读完成。
// 倒计时
let timeinterval="";
let countDownStart="";
countDown(timeTotal) {timeinterval = setInterval(() => {
timeTotal--;
countDownStart = timeTotal + "秒";
if (timeTotal <= 0) {clearInterval(this.timeinterval);
countDownStart = "倒计时开始";
}
}, 1000);
}
countDown(60);
正文完
发表至: javascript
2020-05-27