From 2256e1318e43286038b20b401d2a3042ad6c4c3f Mon Sep 17 00:00:00 2001 From: Mr-lq7 <52699164+Mr-lq7@users.noreply.github.com> Date: Mon, 27 Dec 2021 15:29:29 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E7=A8=8D=E5=8A=A0=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E4=BA=86=E8=8F=9C=E5=8D=95=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layout/components/Sidebar/SidebarItem.vue | 8 ++++---- src/router/index.js | 6 ++++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/layout/components/Sidebar/SidebarItem.vue b/src/layout/components/Sidebar/SidebarItem.vue index a418c3d712..6de1b109eb 100644 --- a/src/layout/components/Sidebar/SidebarItem.vue +++ b/src/layout/components/Sidebar/SidebarItem.vue @@ -68,10 +68,10 @@ export default { } }) - // When there is only one child router, the child router is displayed by default - if (showingChildren.length === 1) { - return true - } + // // When there is only one child router, the child router is displayed by default + // if (showingChildren.length === 1) { + // return true + // } // Show parent if there are no child router to display if (showingChildren.length === 0) { diff --git a/src/router/index.js b/src/router/index.js index 13459e90e2..5aebfbb663 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -47,6 +47,8 @@ export const constantRoutes = [ path: '/', component: Layout, redirect: '/dashboard', + name: 'FatherDashboard', + meta: {title: 'FatherDashboard', icon: 'dashboard'}, children: [{ path: 'dashboard', name: 'Dashboard', @@ -80,6 +82,8 @@ export const constantRoutes = [ { path: '/form', component: Layout, + name: 'FatherForm', + meta: {title: 'FatherForm', icon: 'form'}, children: [ { path: 'index', @@ -152,6 +156,8 @@ export const constantRoutes = [ { path: 'external-link', component: Layout, + name: 'father-external-link', + meta: { title: 'F External Link', icon: 'link' }, children: [ { path: 'https://panjiachen.github.io/vue-element-admin-site/#/', From 962da5acc13e870e7a18fdfb4c288812ca6c2e09 Mon Sep 17 00:00:00 2001 From: Mr-lq7 <52699164+Mr-lq7@users.noreply.github.com> Date: Mon, 27 Dec 2021 15:31:53 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E7=A8=8D=E5=8A=A0=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E4=BA=86=E8=8F=9C=E5=8D=95=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layout/components/Sidebar/SidebarItem.vue | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/layout/components/Sidebar/SidebarItem.vue b/src/layout/components/Sidebar/SidebarItem.vue index 6de1b109eb..c1e273e262 100644 --- a/src/layout/components/Sidebar/SidebarItem.vue +++ b/src/layout/components/Sidebar/SidebarItem.vue @@ -68,10 +68,7 @@ export default { } }) - // // When there is only one child router, the child router is displayed by default - // if (showingChildren.length === 1) { - // return true - // } + // Show parent if there are no child router to display if (showingChildren.length === 0) {