获得徽章 18
function parse(start, end) {
const diff = end - start;
let tmp = parseInt(diff / 1000);
let target = [];
while (tmp > 0) {
target.push(tmp % 60);
tmp = parseInt(tmp / 60);
}
return target;
}
function getCountdown() {
const last = new Date("2023-09-28 18:00").getTime();
const now = new Date().getTime();
return parse(now, last)
.reverse()
.map(c => (c > 9 ? c : `0${c}`))
.join(":");
}
setInterval(() => {
console.log(`%c 倒计时:%s`, "color: red;font-size: 16px;border: 1px solid red;padding: 4px 12px;border-radius: 4px;", getCountdown());
}, 1000); jym, 你们可以使用 `npx nuxi init project-name` 成功创建nuxt项目吗?
jym,你们可以使用 npx nuxi init project-name 成功创建nuxt项目吗?
下一页