提交 | 用户 | 时间
|
314507
|
1 |
import { Layout } from '@/utils/routerHelper' |
H |
2 |
|
|
3 |
const { t } = useI18n() |
|
4 |
/** |
|
5 |
* redirect: noredirect 当设置 noredirect 的时候该路由在面包屑导航中不可被点击 |
|
6 |
* name:'router-name' 设定路由的名字,一定要填写不然使用<keep-alive>时会出现各种问题 |
|
7 |
* meta : { |
|
8 |
hidden: true 当设置 true 的时候该路由不会再侧边栏出现 如404,login等页面(默认 false) |
|
9 |
|
|
10 |
alwaysShow: true 当你一个路由下面的 children 声明的路由大于1个时,自动会变成嵌套的模式, |
|
11 |
只有一个时,会将那个子路由当做根路由显示在侧边栏, |
|
12 |
若你想不管路由下面的 children 声明的个数都显示你的根路由, |
|
13 |
你可以设置 alwaysShow: true,这样它就会忽略之前定义的规则, |
|
14 |
一直显示根路由(默认 false) |
|
15 |
|
|
16 |
title: 'title' 设置该路由在侧边栏和面包屑中展示的名字 |
|
17 |
|
|
18 |
icon: 'svg-name' 设置该路由的图标 |
|
19 |
|
|
20 |
noCache: true 如果设置为true,则不会被 <keep-alive> 缓存(默认 false) |
|
21 |
|
|
22 |
breadcrumb: false 如果设置为false,则不会在breadcrumb面包屑中显示(默认 true) |
|
23 |
|
|
24 |
affix: true 如果设置为true,则会一直固定在tag项中(默认 false) |
|
25 |
|
|
26 |
noTagsView: true 如果设置为true,则不会出现在tag中(默认 false) |
|
27 |
|
|
28 |
activeMenu: '/dashboard' 显示高亮的路由路径 |
|
29 |
|
|
30 |
followAuth: '/dashboard' 跟随哪个路由进行权限过滤 |
|
31 |
|
|
32 |
canTo: true 设置为true即使hidden为true,也依然可以进行路由跳转(默认 false) |
|
33 |
} |
|
34 |
**/ |
|
35 |
const remainingRouter: AppRouteRecordRaw[] = [ |
|
36 |
{ |
|
37 |
path: '/redirect', |
|
38 |
component: Layout, |
|
39 |
name: 'Redirect', |
|
40 |
children: [ |
|
41 |
{ |
|
42 |
path: '/redirect/:path(.*)', |
|
43 |
name: 'Redirect', |
|
44 |
component: () => import('@/views/Redirect/Redirect.vue'), |
|
45 |
meta: {} |
|
46 |
} |
|
47 |
], |
|
48 |
meta: { |
|
49 |
hidden: true, |
|
50 |
noTagsView: true |
|
51 |
} |
|
52 |
}, |
|
53 |
{ |
8e4ab7
|
54 |
path: '/callback', |
H |
55 |
component: () => import('@/views/Login/Callback.vue'), |
|
56 |
name: 'Callback', |
|
57 |
meta: { |
|
58 |
hidden: true, |
|
59 |
noTagsView: true |
|
60 |
} |
|
61 |
}, |
|
62 |
{ |
314507
|
63 |
path: '/home2', |
H |
64 |
component: () => import('@/views/Home/Index2.vue'), |
|
65 |
name: 'Home2', |
|
66 |
meta: { |
|
67 |
hidden: true, |
|
68 |
noTagsView: true |
|
69 |
}, |
|
70 |
}, |
|
71 |
{ |
|
72 |
path: '/', |
|
73 |
component: Layout, |
|
74 |
name: 'Home', |
|
75 |
meta: { |
|
76 |
hidden: true, |
|
77 |
noTagsView: true |
|
78 |
}, |
|
79 |
children: [ |
|
80 |
{ |
|
81 |
path: 'index', |
|
82 |
component: () => import('@/views/Home/Index.vue'), |
|
83 |
name: 'Index', |
|
84 |
meta: { |
|
85 |
title: t('router.home'), |
|
86 |
icon: 'ep:home-filled', |
|
87 |
noCache: false, |
|
88 |
affix: true |
|
89 |
} |
|
90 |
} |
|
91 |
] |
|
92 |
}, |
|
93 |
{ |
8e4ab7
|
94 |
path: '/user', |
H |
95 |
component: Layout, |
|
96 |
name: 'UserInfo', |
|
97 |
meta: { |
|
98 |
hidden: true |
|
99 |
}, |
|
100 |
children: [ |
|
101 |
{ |
|
102 |
path: 'profile', |
|
103 |
component: () => import('@/views/Profile/Index.vue'), |
|
104 |
name: 'Profile', |
|
105 |
meta: { |
|
106 |
canTo: true, |
|
107 |
hidden: true, |
|
108 |
noTagsView: false, |
|
109 |
icon: 'ep:user', |
|
110 |
title: t('common.profile') |
|
111 |
} |
|
112 |
}, |
|
113 |
{ |
|
114 |
path: 'notify-message', |
|
115 |
component: () => import('@/views/system/notify/my/index.vue'), |
|
116 |
name: 'MyNotifyMessage', |
|
117 |
meta: { |
|
118 |
canTo: true, |
|
119 |
hidden: true, |
|
120 |
noTagsView: false, |
|
121 |
icon: 'ep:message', |
|
122 |
title: '我的站内信' |
|
123 |
} |
|
124 |
} |
|
125 |
] |
|
126 |
}, |
|
127 |
{ |
314507
|
128 |
path: '/login', |
H |
129 |
component: () => import('@/views/Login/Login.vue'), |
|
130 |
name: 'Login', |
|
131 |
meta: { |
|
132 |
hidden: true, |
|
133 |
title: t('router.login'), |
|
134 |
noTagsView: true |
|
135 |
} |
|
136 |
}, |
|
137 |
{ |
|
138 |
path: '/403', |
|
139 |
component: () => import('@/views/Error/403.vue'), |
|
140 |
name: 'NoAccess', |
|
141 |
meta: { |
|
142 |
hidden: true, |
|
143 |
title: '403', |
|
144 |
noTagsView: true |
|
145 |
} |
|
146 |
}, |
|
147 |
{ |
|
148 |
path: '/404', |
|
149 |
component: () => import('@/views/Error/404.vue'), |
|
150 |
name: 'NoFound', |
|
151 |
meta: { |
|
152 |
hidden: true, |
|
153 |
title: '404', |
|
154 |
noTagsView: true |
|
155 |
} |
|
156 |
}, |
|
157 |
{ |
|
158 |
path: '/500', |
|
159 |
component: () => import('@/views/Error/500.vue'), |
|
160 |
name: 'Error', |
|
161 |
meta: { |
|
162 |
hidden: true, |
|
163 |
title: '500', |
|
164 |
noTagsView: true |
|
165 |
} |
|
166 |
}, |
|
167 |
{ |
|
168 |
path: '/dict', |
|
169 |
component: Layout, |
|
170 |
name: 'dict', |
|
171 |
meta: { |
|
172 |
hidden: true |
|
173 |
}, |
|
174 |
children: [ |
|
175 |
{ |
|
176 |
path: 'type/data/:dictType', |
|
177 |
component: () => import('@/views/system/dict/data/index.vue'), |
|
178 |
name: 'SystemDictData', |
|
179 |
meta: { |
|
180 |
title: '字典数据', |
|
181 |
noCache: true, |
|
182 |
hidden: true, |
|
183 |
canTo: true, |
|
184 |
icon: '', |
|
185 |
activeMenu: '/system/dict' |
|
186 |
} |
|
187 |
} |
|
188 |
] |
|
189 |
}, |
|
190 |
] |
|
191 |
|
|
192 |
export default remainingRouter |