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

fix: the exception caused by empty menuData in mix navigation mode;
This commit is contained in:
chenghongxing 2020-11-25 20:40:09 +08:00
parent 8c7099c55e
commit 7f4897813e

View File

@ -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: {