From 2c7586ccb87aa8eb39cd2b99a9e632af916ff5d7 Mon Sep 17 00:00:00 2001 From: Pan Date: Wed, 24 Jan 2018 15:01:25 +0800 Subject: [PATCH] feat[menu]: add alwaysShow option --- src/router/index.js | 3 +++ src/views/layout/components/Sidebar/SidebarItem.vue | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/router/index.js b/src/router/index.js index cb5edfe..30b8872 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -11,6 +11,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 (must set!!!) * meta : { diff --git a/src/views/layout/components/Sidebar/SidebarItem.vue b/src/views/layout/components/Sidebar/SidebarItem.vue index 1f75667..3555e73 100644 --- a/src/views/layout/components/Sidebar/SidebarItem.vue +++ b/src/views/layout/components/Sidebar/SidebarItem.vue @@ -2,7 +2,7 @@