JS 前端同时设置多个定时器
time = 10; //前端显示的倒计时时间
pageTimer = {}; // 计时器数组
timerNumber = 0; // 计时器id
// 显示倒计时,点击触发倒计时:
start() {
this.time = 10;
this.pageTimer[this.timerNumber] = setInterval(() => {
this.countDown();
}, 1000);
this.timerNumber = this.timerNum.
原创
2020-07-23 17:13:26 ·
5255 阅读 ·
0 评论