pull/26/head
parent
0d23cf97c1
commit
488247b34b
|
@ -56,14 +56,14 @@ export const constantRoutes = [
|
|||
{
|
||||
path: '',
|
||||
component: Layout,
|
||||
redirect: 'index',
|
||||
redirect: '/home/index',
|
||||
children: [
|
||||
{
|
||||
path: 'index',
|
||||
component: (resolve) => require(['@/views/index'], resolve),
|
||||
name: '首页',
|
||||
meta: { title: '首页', icon: 'dashboard', noCache: true, affix: true }
|
||||
}
|
||||
// {
|
||||
// path: 'index',
|
||||
// component: (resolve) => require(['@/views/index'], resolve),
|
||||
// name: '首页',
|
||||
// meta: { title: '首页', icon: 'dashboard', noCache: true, affix: true }
|
||||
// }
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
|
@ -59,7 +59,11 @@ function filterAsyncRouter(asyncRouterMap, lastRouter = false, type = false) {
|
|||
}
|
||||
if (route.children != null && route.children && route.children.length) {
|
||||
route.children = filterAsyncRouter(route.children, route, type)
|
||||
if (route.children.length === 1 && route.children[0].path === 'index') {
|
||||
route.alwaysShow = false
|
||||
} else {
|
||||
route.alwaysShow = true
|
||||
}
|
||||
} else {
|
||||
delete route['children']
|
||||
delete route['redirect']
|
||||
|
|
Loading…
Reference in New Issue