This commit is contained in:
2025-04-27 20:54:23 +08:00
parent dd9233a6d6
commit b1b5a45bac
2 changed files with 14 additions and 4 deletions

View File

@@ -1,7 +1,7 @@
<template>
<n-flex class="container" :wrap="false">
<n-flex vertical class="menu">
<n-button secondary @click="goHome"> 返回 </n-button>
<n-button secondary @click="goHome">返回</n-button>
<n-button
v-for="item in menu"
:key="item.label"

View File

@@ -3,9 +3,7 @@
<n-gi :span="1">
<n-flex vertical>
<n-flex justify="space-between">
<n-button quaternary @click="$router.push({ name: 'home' })">
返回首页
</n-button>
<n-button quaternary @click="goHome">返回首页</n-button>
<n-flex align="center">
<div>
<n-input
@@ -68,6 +66,9 @@ import Preview from "../components/Preview.vue"
import { submission } from "../store/submission"
import { useRouter, useRoute } from "vue-router"
import { watchDebounced } from "@vueuse/core"
import { taskTab } from "../store/task"
import { step } from "../store/tutorial"
import { TASK_TYPE } from "../utils/const"
const route = useRoute()
const router = useRouter()
@@ -158,6 +159,15 @@ function afterScore() {
})
}
function goHome() {
const query = { task: taskTab.value } as any
if (taskTab.value === TASK_TYPE.Tutorial) query.step = step.value
router.push({
name: "home",
query,
})
}
watch(
() => query.page,
(v) => {