diff options
Diffstat (limited to 'src/router.ts')
-rw-r--r-- | src/router.ts | 67 |
1 files changed, 33 insertions, 34 deletions
diff --git a/src/router.ts b/src/router.ts index f16b418..101fe99 100644 --- a/src/router.ts +++ b/src/router.ts @@ -1,39 +1,38 @@ -import { createRouter, createWebHistory } from 'vue-router'; -import { layouts } from './layouts/index'; +import type { RouteRecordRaw } from 'vue-router'; import HomePage from './pages/Home.page.vue'; +// import { layouts } from './layouts/index'; import NotFound from './pages/404.page.vue'; -import { tools } from './tools'; -import { config } from './config'; +// import { tools } from './tools'; -const toolsRoutes = tools.map(({ path, name, component, ...config }) => ({ - path, - name, - component, - meta: { isTool: true, layout: layouts.toolLayout, name, ...config }, -})); -const toolsRedirectRoutes = tools - .filter(({ redirectFrom }) => redirectFrom && redirectFrom.length > 0) - .flatMap( - ({ path, redirectFrom }) => redirectFrom?.map((redirectSource) => ({ path: redirectSource, redirect: path })) ?? [], - ); +// const toolsRoutes = tools.map(({ path, name, component, ...config }) => ({ +// path, +// name, +// component, +// meta: { isTool: true, layout: layouts.toolLayout, name, ...config }, +// })); +// const toolsRedirectRoutes = tools +// .filter(({ redirectFrom }) => redirectFrom && redirectFrom.length > 0) +// .flatMap( +// ({ path, redirectFrom }) => redirectFrom?.map((redirectSource) => ({ path: redirectSource, redirect: path })) ?? [], +// ); +// +// console.log({ toolsRoutes, toolsRedirectRoutes }); -const router = createRouter({ - history: createWebHistory(config.app.baseUrl), - routes: [ - { - path: '/', - name: 'home', - component: HomePage, - }, - { - path: '/about', - name: 'about', - component: () => import('./pages/About.vue'), - }, - ...toolsRoutes, - ...toolsRedirectRoutes, - { path: '/:pathMatch(.*)*', name: 'NotFound', component: NotFound }, - ], -}); +const routes: RouteRecordRaw[] = [ + // ...toolsRoutes, + // ...toolsRedirectRoutes, + { + path: '/', + name: 'home', + component: HomePage, + }, + // { + // path: '/about', + // name: 'about', + // component: () => import('./pages/About.vue'), + // }, -export default router; + // { path: '/:pathMatch(.*)*', name: 'NotFound', component: NotFound }, +]; + +export { routes }; |