fix
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user