web-map/src/services/router.ts
2025-04-28 20:04:46 +08:00

26 lines
638 B
TypeScript

import { createRouter, createWebHistory, type RouteRecordRaw } from 'vue-router';
export const ROUTES = Object.freeze<RouteRecordRaw[]>([
{ path: '/:pathMatch(.*)*', redirect: '/exception/404' },
{
path: '/exception/:code',
props: true,
component: () => import('@/exception.vue'),
},
{
path: '/scene-editor/:id',
props: true,
component: () => import('@/scene-editor.vue'),
},
{
path: '/group-editor/:id',
props: true,
component: () => import('@/group-editor.vue'),
},
]);
export const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL),
routes: ROUTES,
});