fix: 修复plugin-layout中计算默认展开菜单未考虑未配置在菜单的路由场景

This commit is contained in:
wanchun 2023-03-06 16:02:49 +08:00
parent 04a605ab77
commit ab728842aa

View File

@ -96,6 +96,9 @@ export default {
});
const defaultExpandMenu = computed(() => {
let index = menuArray.value.findIndex((item) => item.value === activePath.value);
if (index === -1) {
return props.expandedKeys;
}
const activeMenu = menuArray.value[index];
const arr = [activeMenu];
while (index > 0) {