ForcePilot/web/src/router/index.js

94 lines
2.3 KiB
JavaScript
Raw Normal View History

import { createRouter, createWebHistory } from 'vue-router'
2024-07-14 16:42:38 +08:00
import AppLayout from '@/layouts/AppLayout.vue';
import BlankLayout from '@/layouts/BlankLayout.vue';
const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL),
routes: [
{
path: '/',
name: 'home',
2024-07-14 16:42:38 +08:00
component: BlankLayout,
children: [ {
path: '',
name: 'home',
2024-07-16 18:14:27 +08:00
component: () => import('../views/HomeView.vue'),
2024-07-14 16:42:38 +08:00
meta: { keepAlive: true }
}
]
},
{
path: '/chat',
name: 'chat',
2024-07-14 16:42:38 +08:00
component: AppLayout,
children: [
{
path: '',
name: 'Chat',
2024-07-16 18:14:27 +08:00
component: () => import('../views/ChatView.vue'),
2024-07-14 16:42:38 +08:00
meta: { keepAlive: true }
}
]
},
2024-07-14 16:42:38 +08:00
{
2024-07-16 18:14:27 +08:00
path: '/database',
name: 'database',
2024-07-14 16:42:38 +08:00
component: AppLayout,
children: [
{
path: '',
2024-07-16 18:14:27 +08:00
name: 'database',
component: () => import('../views/DataBaseView.vue'),
2024-07-14 16:42:38 +08:00
meta: { keepAlive: true }
2024-07-16 18:14:27 +08:00
},
{
path: ':database_id',
name: 'databaseInfo',
component: () => import('../views/DataBaseInfoView.vue'),
2024-07-17 18:52:20 +08:00
},
{
path: 'graph',
name: 'graph',
component: () => import('../views/GraphView.vue'),
meta: { keepAlive: true }
2024-07-14 16:42:38 +08:00
}
]
},
{
path: '/setting',
name: 'setting',
component: AppLayout,
children: [
{
path: '',
name: 'setting',
2024-07-16 18:14:27 +08:00
component: () => import('../views/EmptyView.vue'),
2024-07-14 16:42:38 +08:00
meta: { keepAlive: true }
}
]
},
{
path: '/:pathMatch(.*)*',
name: 'NotFound',
2024-07-16 18:14:27 +08:00
component: () => import('../views/EmptyView.vue')
2024-07-14 16:42:38 +08:00
}
// {
// path: '/kg',
// name: 'knowledge-graph',
// // route level code-splitting
// // this generates a separate chunk (About.[hash].js) for this route
// // which is lazy-loaded when the route is visited.
// component: () => import('../views/GraphView.vue'),
// meta: { keepAlive: true }
// },
// {
// path: '/about',
// name: 'about',
// component: () => import('../views/AboutView.vue'),
// meta: { keepAlive: true }
// }
]
})
export default router