timeCount() {
// 会议计时
let tempTime = 0;
let second = 0;
let minute = 0;
let hour = 0;
this.timeData = "";
this.timer = setInterval(() => {
tempTime += 1;
hour = parseInt(tempTime%3600) ; // 转小时
minute = parseInt(tempTime%3600/60); // 转分钟
second = parseInt(tempTime%3600%60); // 转秒
// 格式化
hour = (hour > 9 ? hour : "0" + hour) + "";
minute = (minute > 9 ? minute : "0" + minute) + "";
second = (second > 9 ? second : "0" + second) + "";
this.timeData = hour + ":" + minute + ":" + second;
}, 1000);
},
网友评论