From 23b7dfe2a4087be1c28d6c59768178553e929d56 Mon Sep 17 00:00:00 2001 From: chenghongxing <1126263215@qq.com> Date: Wed, 25 Nov 2020 20:39:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=E6=B7=B7=E5=90=88?= =?UTF-8?q?=E5=AF=BC=E8=88=AA=E6=A8=A1=E5=BC=8F=E4=B8=8B=EF=BC=8C=E8=8F=9C?= =?UTF-8?q?=E5=8D=95=E6=95=B0=E6=8D=AE=E4=B8=BA=E7=A9=BA=E6=97=B6=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E7=9A=84=E5=BC=82=E5=B8=B8=EF=BC=9B:bug:=20fix:=20the?= =?UTF-8?q?=20exception=20caused=20by=20empty=20menuData=20in=20mix=20navi?= =?UTF-8?q?gation=20mode;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/modules/setting.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/store/modules/setting.js b/src/store/modules/setting.js index ce3857d..89a6e2b 100644 --- a/src/store/modules/setting.js +++ b/src/store/modules/setting.js @@ -39,11 +39,11 @@ export default { }, subMenu(state) { const {menuData, activatedFirst} = state - if (!menuData[0].fullPath) { + if (menuData.length > 0 && !menuData[0].fullPath) { formatFullPath(menuData) } const current = menuData.find(menu => menu.fullPath === activatedFirst) - return current && current.children ? current.children : [] + return current && current.children || [] } }, mutations: {