From 6d1eb472d9549f98ba4fe5b2f38cb1b51f8e192d Mon Sep 17 00:00:00 2001 From: m00ny Date: Tue, 12 Dec 2023 23:58:15 +0300 Subject: [PATCH] wip: setup multi-level routing --- src/pages/options/index.ts | 11 ++++++++++- src/pages/options/routes/Settings.vue | 1 + src/pages/options/routes/Settings/Developer.vue | 4 +++- src/pages/options/routes/Settings/General.vue | 9 +++++++++ 4 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 src/pages/options/routes/Settings/General.vue diff --git a/src/pages/options/index.ts b/src/pages/options/index.ts index c5380aa..98e91fc 100644 --- a/src/pages/options/index.ts +++ b/src/pages/options/index.ts @@ -2,6 +2,7 @@ import { createApp } from "vue"; import { createRouter, createWebHashHistory } from "vue-router"; import App from "./App.vue"; import Settings from "./routes/Settings.vue"; +import General from "./routes/Settings/General.vue"; import Developer from "./routes/Settings/Developer.vue"; import Inventory from "./routes/Inventory.vue"; import Onboarding from "./routes/Onboarding.vue"; @@ -15,12 +16,20 @@ const router = createRouter history: createWebHashHistory(), routes: [ + { + path: "/", + redirect: "/settings", + }, { path: "/settings", component: Settings, - alias: "/", + redirect: "/settings/general", children: [ + { + path: "general", + component: General, + }, { path: "developer", component: Developer, diff --git a/src/pages/options/routes/Settings.vue b/src/pages/options/routes/Settings.vue index fa1f198..1a39ef8 100644 --- a/src/pages/options/routes/Settings.vue +++ b/src/pages/options/routes/Settings.vue @@ -2,6 +2,7 @@ \ No newline at end of file diff --git a/src/pages/options/routes/Settings/Developer.vue b/src/pages/options/routes/Settings/Developer.vue index c88060f..31b255d 100644 --- a/src/pages/options/routes/Settings/Developer.vue +++ b/src/pages/options/routes/Settings/Developer.vue @@ -1,6 +1,8 @@ - + \ No newline at end of file diff --git a/src/pages/options/routes/Settings/General.vue b/src/pages/options/routes/Settings/General.vue new file mode 100644 index 0000000..4b3f715 --- /dev/null +++ b/src/pages/options/routes/Settings/General.vue @@ -0,0 +1,9 @@ + + + + + \ No newline at end of file