fix
This commit is contained in:
@@ -3,9 +3,7 @@
|
|||||||
<n-gi :span="1">
|
<n-gi :span="1">
|
||||||
<n-flex vertical>
|
<n-flex vertical>
|
||||||
<n-flex justify="space-between">
|
<n-flex justify="space-between">
|
||||||
<n-button quaternary @click="$router.push({ name: 'home' })">
|
<n-button quaternary @click="goHome">返回首页</n-button>
|
||||||
返回首页
|
|
||||||
</n-button>
|
|
||||||
<n-flex align="center">
|
<n-flex align="center">
|
||||||
<div>
|
<div>
|
||||||
<n-input
|
<n-input
|
||||||
@@ -68,6 +66,9 @@ import Preview from "../components/Preview.vue"
|
|||||||
import { submission } from "../store/submission"
|
import { submission } from "../store/submission"
|
||||||
import { useRouter, useRoute } from "vue-router"
|
import { useRouter, useRoute } from "vue-router"
|
||||||
import { watchDebounced } from "@vueuse/core"
|
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 route = useRoute()
|
||||||
const router = useRouter()
|
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(
|
watch(
|
||||||
() => query.page,
|
() => query.page,
|
||||||
(v) => {
|
(v) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user