修复:混合导航模式下,菜单数据为空时导致的异常;🐛

fix: the exception caused by empty menuData in mix navigation mode;
This commit is contained in:
chenghongxing 2020-11-25 20:39:21 +08:00
parent 10296fd022
commit 23b7dfe2a4

View File

@ -39,11 +39,11 @@ export default {
}, },
subMenu(state) { subMenu(state) {
const {menuData, activatedFirst} = state const {menuData, activatedFirst} = state
if (!menuData[0].fullPath) { if (menuData.length > 0 && !menuData[0].fullPath) {
formatFullPath(menuData) formatFullPath(menuData)
} }
const current = menuData.find(menu => menu.fullPath === activatedFirst) const current = menuData.find(menu => menu.fullPath === activatedFirst)
return current && current.children ? current.children : [] return current && current.children || []
} }
}, },
mutations: { mutations: {