feat: fixed the regression of changing Menu to MenuUI

This commit is contained in:
Harold Zhang
2026-06-04 11:46:53 +08:00
parent 790e114d41
commit 6b7cb7b1fc
5 changed files with 8 additions and 8 deletions

View File

@@ -42,7 +42,7 @@ function useSubMenuContext() {
if (!instance) {
throw new Error('instance is required');
}
const parentMenu = findComponentUpward(instance, ['Menu', 'SubMenu']);
const parentMenu = findComponentUpward(instance, ['MenuUI', 'SubMenu']);
const subMenu = inject(`subMenu:${parentMenu?.uid}`) as SubMenuProvider;
return subMenu;
}

View File

@@ -16,7 +16,7 @@ function useMenu() {
const parentPaths = computed(() => {
let parent = instance.parent;
const paths: string[] = [instance.props.path as string];
while (parent?.type.name !== 'Menu') {
while (parent?.type.name !== 'MenuUI') {
if (parent?.props.path) {
paths.unshift(parent.props.path as string);
}
@@ -27,7 +27,7 @@ function useMenu() {
});
const parentMenu = computed(() => {
return findComponentUpward(instance, ['Menu', 'SubMenu']);
return findComponentUpward(instance, ['MenuUI', 'SubMenu']);
});
return {