routes.js
756 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import login from '@/views/login/login.vue'
const errorPage = [
{
path: '/404',
component: () => import('@/views/404'),
hidden: true
},
{ path: '*', redirect: '/404', hidden: true }
]
const frameOut = [
{
path: '/',
name: 'login',
component: login,
}
]
const constantRoutes = [
{
path: '/panel',
code: 'panel',
component: () => import('@/views/Home'),
redirect: '/panel',
children: [
{
path: '/panel',
name: '首页',
code: '0-1',
component: () => import('@/views/panel/index')
}
]
}
]
// 在这里面动态引入路由文件 达成权限处理得问题
// 重新组织后导出
export default [
...errorPage,
...frameOut,
...constantRoutes
]