Skip to content

Commit

Permalink
wip: setup multi-level routing
Browse files Browse the repository at this point in the history
  • Loading branch information
i-Moony committed Dec 12, 2023
1 parent 047f433 commit 6d1eb47
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 2 deletions.
11 changes: 10 additions & 1 deletion src/pages/options/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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,
Expand Down
1 change: 1 addition & 0 deletions src/pages/options/routes/Settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

<template>
<p>Settings!</p>
<RouterView></RouterView>
</template>

<style scoped></style>
4 changes: 3 additions & 1 deletion src/pages/options/routes/Settings/Developer.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<script setup lang="ts">
</script>

<template></template>
<template>
<p>Developer</p>
</template>

<style scoped></style>
9 changes: 9 additions & 0 deletions src/pages/options/routes/Settings/General.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<script setup lang="ts">
</script>

<template>
<p>General</p>
</template>

<style scoped>
</style>

0 comments on commit 6d1eb47

Please sign in to comment.