Files
dcalc/frontendNew/src/router/index.ts
T
2026-06-12 19:05:40 +08:00

82 lines
2.2 KiB
TypeScript

import { createRouter, createWebHistory } from "vue-router";
const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL),
routes: [
{
path: "/",
component: () => import("@/pages/index.vue"),
},
{
path: "/dnf-vp",
name: "dnf-vp",
component: () => import("@/pages/DnfVp/Index.vue"),
},
{
path: "/dnf-vp/detail",
name: "dnf-vp-detail",
component: () => import("@/pages/DnfVp/Detail.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;