From 445c46391d91e9a354eef20c8b8287059a058417 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B0=B4=E8=90=BD=28YangLei=29?= Date: Mon, 5 Jul 2021 18:59:59 +0800 Subject: [PATCH] =?UTF-8?q?bugfix:=20=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 4 +--- src/components/menu/menu.js | 1 + 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/App.vue b/src/App.vue index 3246e33..e1674d3 100644 --- a/src/App.vue +++ b/src/App.vue @@ -66,9 +66,7 @@ export default { }, setHtmlTitle() { const route = this.$route; - const key = - route.path === '/' ? 'home.name' : getI18nKey(route.matched[route.matched.length - 1].path); - document.title = process.env.VUE_APP_NAME + ' | ' + this.$t(key); + if (route.name) window.title = route.name; }, popContainer() { return document.getElementById('popContainer'); diff --git a/src/components/menu/menu.js b/src/components/menu/menu.js index 884999f..e24b0c2 100644 --- a/src/components/menu/menu.js +++ b/src/components/menu/menu.js @@ -186,6 +186,7 @@ export default { getOpenKeysByPath(path) { const { menuList } = getUserInfo(); const { parentMenuId } = this.menuData.find(m => m.menuUrl === path); + if (parentMenuId === 0) return []; const parentMenus = [parentMenuId]; const res = [parentMenuId]; while (parentMenus.length) { -- GitLab