setTimeCount() {
setInterval(() => {
for (let j = 0; j < this.products2.length; j++) {
const now = Math.round(new Date().getTime());
let tmpProducts = [];
tmpProducts = this.products2;
if (tmpProducts[j].started_at !== null) {
tmpProducts[j].started_at = tmpProducts[j].started_at.replace(/\-/g, '/');
this.$set(this.products2[j], 'overtime', Date.parse(this.products2[j].started_at) - now);
this.$set(this.products2[j], 'overD', Math.floor(Math.floor((Date.parse(tmpProducts[j].started_at) - now) / 1000 / 60 / 60 / 24)));
this.$set(this.products2[j], 'overH', Math.floor((Date.parse(tmpProducts[j].started_at) - now) / 1000 / 60 / 60 % 24));
this.$set(this.products2[j], 'overM', Math.floor((Date.parse(tmpProducts[j].started_at) - now) / 1000 / 60 % 60));
this.$set(this.products2[j], 'overS', Math.floor((Date.parse(tmpProducts[j].started_at) - now) / 1000 % 60));
}
}
}, 1000);
}
vue 项目页面出现多个时间 倒计时的
猜你喜欢
转载自blog.csdn.net/qq_41422208/article/details/85336325
今日推荐
周排行