fixing sub path
This commit is contained in:
parent
4317f7f7d1
commit
d9fca2f4a8
5 changed files with 103 additions and 105 deletions
|
|
@ -2,7 +2,7 @@ import type { RouteRecordRaw } from "vue-router";
|
|||
// import { ref } from "vue";
|
||||
// import { useRoute } from "vue-router";
|
||||
const Error404NotFound = () => import("@/views/Error404NotFound.vue");
|
||||
const data = await fetch("/manual/toc.json").then((r) => r.json());
|
||||
const data = await fetch("/toc.json").then((r) => r.json());
|
||||
|
||||
// const routes = useRoute();
|
||||
// const hasQueryParam = ref<boolean>(false);
|
||||
|
|
@ -41,14 +41,12 @@ const manualRoute = mergeManual.map(
|
|||
|
||||
const route: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/manual/:name",
|
||||
path: "/:name",
|
||||
name: "Manual",
|
||||
component: () => import("@/modules/01_manual/MainPage.vue"),
|
||||
beforeEnter: (to, from, next) => {
|
||||
const mergeAll = [...mainDataInfo, ...manualRoute];
|
||||
const itemExists = mergeAll.some(
|
||||
(item) => item.path === window.location.pathname
|
||||
);
|
||||
const itemExists = mergeAll.some((item) => item.name === "Manual");
|
||||
|
||||
if (itemExists) {
|
||||
next();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue