From 69f02eabd5ecc513278240641b701307161f9d9f Mon Sep 17 00:00:00 2001 From: 25Ericcheong Date: Sat, 18 May 2024 21:04:56 +0800 Subject: [PATCH] fix: Additional nav guarding just in case --- src/router/router.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/router/router.ts b/src/router/router.ts index c6caef8..13a7b9b 100644 --- a/src/router/router.ts +++ b/src/router/router.ts @@ -9,8 +9,8 @@ const PATHS = { }; const routes = [ - { path: PATHS.HOME, component: Home }, - { path: PATHS.MENU, component: Menu }, + { name: "home", path: PATHS.HOME, component: Home }, + { name: "menu", path: PATHS.MENU, component: Menu }, ]; const router = createRouter({ @@ -18,4 +18,8 @@ const router = createRouter({ routes, }); +router.onError(() => { + return { name: "home", path: PATHS.HOME, component: Home }; +}); + export { PATHS, router };