嵌套 route 调整
This commit is contained in:
parent
6d539a3055
commit
fd30f84af5
@ -16,7 +16,7 @@
|
||||
"pinia": "^2.0.21",
|
||||
"vue": "^3.2.38",
|
||||
"vue-i18n": "^9.2.2",
|
||||
"vue-router": "^4.1.5"
|
||||
"vue-router": "^4.2.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^16.11.56",
|
||||
|
@ -1 +1 @@
|
||||
7dc8355d48f99175c4067c253750bda0
|
||||
15a19573e5ac860a508a6ee2598ed3e8
|
@ -6,6 +6,10 @@ import {useGlobalConfig} from "@/stores/globalConfig";
|
||||
import {watch,onBeforeUnmount } from "vue";
|
||||
import {useMagicKeys, whenever} from "@vueuse/core";
|
||||
import {destroyDebugger, switchDebugger} from "@/utils/debugger/eruda";
|
||||
import {useRoute} from "vue-router";
|
||||
|
||||
let routeLocationNormalizedLoaded = useRoute();
|
||||
console.log(routeLocationNormalizedLoaded)
|
||||
|
||||
const {t, availableLocales: languages, locale} = useI18n();
|
||||
let globalConfig = useGlobalConfig();
|
||||
@ -82,7 +86,7 @@ document.body.addEventListener("click", function (event) {
|
||||
<el-config-provider v-bind="elementUIConfig">
|
||||
<el-select></el-select>
|
||||
<router-view v-slot="{ Component, route }">
|
||||
<component v-if="!route.children" :is="Component"/>
|
||||
<component v-if="route.matched && route.matched.length > 0 && route.matched[0].children.length === 0" :is="Component"/>
|
||||
<transition v-else name="fade" mode="out-in">
|
||||
<div style="height: 100vh" class="overflow-auto">
|
||||
<component
|
||||
|
@ -8,6 +8,7 @@ const router = createRouter({
|
||||
path: "/",
|
||||
name: "home",
|
||||
component: HomeView,
|
||||
children: []
|
||||
},
|
||||
{
|
||||
path: "/about",
|
||||
|
@ -6,8 +6,11 @@
|
||||
"paths": {
|
||||
"@/*": ["./src/*"]
|
||||
},
|
||||
"allowJs": true,
|
||||
"strict": false,
|
||||
"noImplicitAny": false
|
||||
"noImplicitAny": false,
|
||||
"noUnusedLocals": false,
|
||||
"strictNullChecks": false
|
||||
},
|
||||
|
||||
"references": [
|
||||
|
@ -2959,7 +2959,7 @@ vue-i18n@^9.2.2:
|
||||
"@intlify/shared" "9.9.1"
|
||||
"@vue/devtools-api" "^6.5.0"
|
||||
|
||||
vue-router@^4.1.5:
|
||||
vue-router@^4.2.5:
|
||||
version "4.2.5"
|
||||
resolved "https://registry.npmmirror.com/vue-router/-/vue-router-4.2.5.tgz#b9e3e08f1bd9ea363fdd173032620bc50cf0e98a"
|
||||
integrity sha512-DIUpKcyg4+PTQKfFPX88UWhlagBEBEfJ5A8XDXRJLUnZOvcpMF8o/dnL90vpVkGaPbjvXazV/rC1qBKrZlFugw==
|
||||
|
Loading…
Reference in New Issue
Block a user