跳转到首页

This commit is contained in:
2025-04-28 09:28:41 +08:00
parent 69c3a36957
commit 4beab17b70
7 changed files with 52 additions and 50 deletions

View File

@@ -1,6 +1,15 @@
import { useDateFormat } from "@vueuse/core"
import { TASK_TYPE } from "./const"
export function parseTime(utc: Date | string, format = "YYYY年M月D日") {
const time = useDateFormat(utc, format, { locales: "zh-CN" })
return time.value
}
export function goHome(router: any, type: TASK_TYPE, step: number) {
const query = { type } as any
if (type === TASK_TYPE.Tutorial) {
query.step = step
}
router.push({ name: "home", query })
}