refactor: go to Error404

This commit is contained in:
oat_dev 2024-07-01 10:21:21 +07:00
parent 471883e5e5
commit 6ab696fd60

View file

@ -29,19 +29,33 @@ const route: RouteRecordRaw[] = [
if (itemExists) { if (itemExists) {
next(); next();
} else { } else {
next({ name: "Error404NotFound" }); next({
name: "Error404NotFound",
params: { pathMatch: to.path.substring(1).split("/") },
});
} }
}, },
}, },
{ {
path: "/:name", path: "/build-and-deploy",
name: "Pages", name: "BuildAndDeploy",
component: () => import("@/modules/02_pages/MainPage.vue"), component: () => import("@/modules/02_pages/MainPage.vue"),
}, },
{
path: "/debug",
name: "Debug",
component: () => import("@/modules/02_pages/MainPage.vue"),
},
// {
// path: "/:name",
// name: "Pages",
// component: () => import("@/modules/02_pages/MainPage.vue"),
// },
{ {
path: "/:pathMatch(.*)*", path: "/:pathMatch(.*)*",
name: "Error404NotFound", name: "Error404NotFound",
component: Error404NotFound, component: Error404NotFound,
props: true,
}, },
]; ];