|
|
@@ -69,7 +69,7 @@
|
|
|
|
|
|
// 获取当前打开的子菜单
|
|
|
const matched = currentRoute.matched;
|
|
|
- const activeMenu = currentRoute.meta?.activeMenu ?? null;
|
|
|
+ const activeMenu = currentRoute.meta?.activeMenu || null; // activeMenu undefined,null 或 空字符串,统一变为 null。
|
|
|
const selectedKeys = ref<string>((activeMenu ?? currentRoute.name) as string);
|
|
|
const openKeys = ref(matched && matched.length ? matched.map((item) => item.name) : []);
|
|
|
|
|
|
@@ -86,6 +86,8 @@
|
|
|
|
|
|
const getSelectedKeys = computed(() => {
|
|
|
let location = props.location;
|
|
|
+ console.log('location', location);
|
|
|
+ console.log('selectedKeys', selectedKeys.value);
|
|
|
return location === 'left' || (location === 'header' && unref(navMode) === 'horizontal')
|
|
|
? unref(selectedKeys)
|
|
|
: unref(headerMenuSelectKey);
|