chore: 将前端移动到 client/ 目录,准备合并为单仓库
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
1f6935e31e
commit
d1c6b8c201
79 files changed
No files matched your search
@@ -0,0 +1,18 @@
|
||||
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, display: number) {
|
||||
if (type === TASK_TYPE.Tutorial) {
|
||||
router.push({ name: "home-tutorial", params: { display } })
|
||||
} else if (type === TASK_TYPE.Challenge) {
|
||||
if (display) router.push({ name: "home-challenge", params: { display } })
|
||||
else router.push({ name: "home-challenge-list" })
|
||||
} else {
|
||||
router.push({ name: "home" })
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user