Files
FiDA_Front/src/router/index.ts

92 lines
2.1 KiB
TypeScript
Raw Normal View History

2026-02-02 13:32:33 +08:00
import { createRouter, createWebHistory } from 'vue-router'
/**
* :
* 1. meta属性为{ cache: true }
* 2. App.vue中使用RouteCache组件name来进行匹配
* 3. name默认是文件名,name不一致,defineOptions({ name: 'componentName' })
*/
const router = createRouter({
2026-02-26 11:45:32 +08:00
history: createWebHistory('/'),
// history: createWebHistory(import.meta.env.VITE_APP_URL),
routes: [
{
path: '/',
redirect: '/index'
},
{
path: '/index',
name: 'index',
2026-03-03 15:39:54 +08:00
component: () => import('../views/login/index.vue'),
meta: { notToken: true }
2026-02-26 11:45:32 +08:00
},
{
path: '/login',
name: 'login',
2026-03-03 15:39:54 +08:00
component: () => import('../views/login/login.vue'),
meta: { notToken: true }
2026-02-26 11:45:32 +08:00
},
{
path: '/register',
name: 'register',
2026-03-03 15:39:54 +08:00
component: () => import('../views/login/register.vue'),
meta: { notToken: true }
2026-02-26 11:45:32 +08:00
},
2026-02-26 13:47:26 +08:00
{
path: '/retrievepass',
name: 'retrievepass',
2026-03-03 15:39:54 +08:00
component: () => import('../views/login/retrieve-password.vue'),
meta: { notToken: true }
2026-02-26 13:47:26 +08:00
},
2026-02-26 11:45:32 +08:00
{
path: '/nuic',
name: 'nuic',
component: () => import('../views/nuic/index.vue')
},
{
path: '/home',
name: 'home',
component: () => import('../views/home/index.vue'),
children: [
{
2026-02-27 17:32:56 +08:00
path: 'test',
2026-02-26 11:45:32 +08:00
name: 'test',
component: () => import('../views/home/test.vue'),
meta: { topNavStyle: '2' }
},
{
path: '/home/versionTree',
name: 'versionTree',
component: () => import('../views/home/VersionTree.vue'),
meta: { topNavStyle: '2' }
},
{
path: 'mainInput',
name: 'mainInput',
component: () => import('../views/home/mainInput.vue')
},
{
2026-02-27 16:47:02 +08:00
path: 'agent/:id',
2026-02-26 11:45:32 +08:00
name: 'agent',
component: () => import('../views/home/agent/index.vue')
}
]
},
{
path: '/canvastest',
name: 'canvastest',
2026-03-03 15:39:54 +08:00
component: () => import('../components/Canvas/CanvasTest.vue'),
meta: { notToken: true }
2026-02-26 11:45:32 +08:00
},
2026-02-10 13:05:24 +08:00
2026-02-26 13:47:26 +08:00
{
2026-02-26 11:45:32 +08:00
path: '/:pathMatch(.*)',
name: '404',
2026-03-03 15:39:54 +08:00
component: () => import('../views/404.vue'),
meta: { notToken: true }
2026-02-26 11:45:32 +08:00
}
]
2026-02-02 13:32:33 +08:00
})
export default router