在路径 ui/src/router/*中添加路由路径,并在对应的路径中生成文件。
ui/src/router/*
以 user为例。
user
因为所属数据为后台,在 ui/src/router/components/other/admin/index.ts 文件中修改如下:
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 即可
routeKeys
template
当你的文件不符合以上时,请在 router/components/other/index.ts 中添加完善路由信息。如下所示:
router/components/other/index.ts
添加路由后并完善路由文件信息。
Last updated 3 years ago
const routes = [ { path: '/test', name: 'Test', component: () => import('@/views/test/Index.vue'), }, ] export default routes