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