路由
在路径 ui/src/router/*
中添加路由路径,并在对应的路径中生成文件。
示例
以 user
为例。
因为所属数据为后台,在 ui/src/router/components/other/admin/index.ts
文件中修改如下:
const routeKeys = [
'home',
'admin',
'admin-group',
'admin-log',
'user', // 添加 user , 对应在 views/Admin/ 下新建 user/Index.vue 文件
'menu',
];
事项一
如果你的页面及路由符合以下格式
url => admin/template
文件(Index.vue) => views/Admin/template/Index.vue
🎉 你可以,直接在 routeKeys
中添加 template
即可
事项二
当你的文件不符合以上时,请在 router/components/other/index.ts
中添加完善路由信息。如下所示:
const routes = [
{
path: '/test',
name: 'Test',
component: () => import('@/views/test/Index.vue'),
},
]
export default routes
添加路由后并完善路由文件信息。
Last updated
Was this helpful?