feat[menu]: add alwaysShow option

This commit is contained in:
Pan
2018-01-24 14:47:20 +08:00
parent 2e0d3fd0e4
commit 6f2a7ce804
4 changed files with 20 additions and 13 deletions

View File

@@ -15,6 +15,9 @@ import Layout from '../views/layout/Layout'
/**
* hidden: true if `hidden:true` will not show in the sidebar(default is false)
* alwaysShow: true if set true, will always show the root menu, whatever its child routes length
* if not set alwaysShow, only more than one route under the children
* it will becomes nested mode, otherwise not show the root menu
* redirect: noredirect if `redirect:noredirect` will no redirct in the breadcrumb
* name:'router-name' the name is used by <keep-alive> (must set!!!)
* meta : {
@@ -217,7 +220,9 @@ export const asyncRouterMap = [
path: '/zip',
component: Layout,
redirect: '/zip/download',
children: [{ path: 'download', component: _import('zip/index'), name: 'exportZip', meta: { title: 'exportZip', icon: 'zip' }}]
alwaysShow: true,
meta: { title: 'zip', icon: 'zip' },
children: [{ path: 'download', component: _import('zip/index'), name: 'exportZip', meta: { title: 'exportZip' }}]
},
{