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

fix: the exception caused by empty menuData in mix navigation mode;
master
chenghongxing 4 years ago
parent 10296fd022
commit 23b7dfe2a4
  1. 4
      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: {

Loading…
Cancel
Save