import { createRouter, createWebHistory } from "vue-router"; const router = createRouter({ history: createWebHistory(import.meta.env.BASE_URL), routes: [ { path: "/", component: () => import("@/pages/index.vue"), }, { path: "/dcalc", component: () => import("@/pages/index.vue"), children: [ { path: "", redirect: "/dcalc/home", }, { path: "home", name: "home", component: () => import("@/pages/Dcalc/Home/Index.vue"), }, { path: "dnfhelper", name: "dnfhelper", component: () => import("@/pages/Dcalc/DnfHelper/index.vue"), }, { path: "character/:alter", name: "character", props: true, component: () => import("@/pages/Dcalc/Character/Index.vue"), redirect: (to) => { return { name: "character-equipment", params: { alter: to.params.alter }, }; }, children: [ { path: "equipment", name: "character-equipment", component: () => import("@/pages/Dcalc/Character/EquipmentDictionary/Index.vue"), }, { path: "skill", name: "character-skill", component: () => import("@/pages/Dcalc/Character/Skill/index.vue"), }, { path: "forge", name: "character-forge", component: () => import("@/pages/Dcalc/Character/Forge/index.vue"), }, { path: "result", name: "character-result", component: () => import("@/pages/Dcalc/Character/CalcDetail/index.vue"), }, ], }, ], }, { path: "/:pathMatch(.*)*", redirect: "/dcalc/home", }, ], }); export default router;