feat: fixed the regression of changing Menu to MenuUI
parent
790e114d41
commit
6b7cb7b1fc
|
|
@ -1,7 +1,7 @@
|
||||||
---
|
---
|
||||||
"@vben/styles": patch
|
'@vben/styles': patch
|
||||||
"@vben-core/form-ui": patch
|
'@vben-core/form-ui': patch
|
||||||
"@vben/web-naive": patch
|
'@vben/web-naive': patch
|
||||||
---
|
---
|
||||||
|
|
||||||
feat(@core/form-ui): 新增 useVbenForm 数组编辑器 VbenFormFieldArray
|
feat(@core/form-ui): 新增 useVbenForm 数组编辑器 VbenFormFieldArray
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ const menuIcon = computed(() =>
|
||||||
const isHttp = computed(() => isHttpUrl(item.parentPaths.at(-1)));
|
const isHttp = computed(() => isHttpUrl(item.parentPaths.at(-1)));
|
||||||
|
|
||||||
const isTopLevelMenuItem = computed(
|
const isTopLevelMenuItem = computed(
|
||||||
() => parentMenu.value?.type.name === 'Menu',
|
() => parentMenu.value?.type.name === 'MenuUI',
|
||||||
);
|
);
|
||||||
|
|
||||||
const collapseShowTitle = computed(
|
const collapseShowTitle = computed(
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ const opened = computed(() => {
|
||||||
return rootMenu?.openedMenus.includes(props.path);
|
return rootMenu?.openedMenus.includes(props.path);
|
||||||
});
|
});
|
||||||
const isTopLevelMenuSubmenu = computed(
|
const isTopLevelMenuSubmenu = computed(
|
||||||
() => parentMenu.value?.type.name === 'Menu',
|
() => parentMenu.value?.type.name === 'MenuUI',
|
||||||
);
|
);
|
||||||
const mode = computed(() => rootMenu?.props.mode ?? 'vertical');
|
const mode = computed(() => rootMenu?.props.mode ?? 'vertical');
|
||||||
const rounded = computed(() => rootMenu?.props.rounded);
|
const rounded = computed(() => rootMenu?.props.rounded);
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ function useSubMenuContext() {
|
||||||
if (!instance) {
|
if (!instance) {
|
||||||
throw new Error('instance is required');
|
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;
|
const subMenu = inject(`subMenu:${parentMenu?.uid}`) as SubMenuProvider;
|
||||||
return subMenu;
|
return subMenu;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ function useMenu() {
|
||||||
const parentPaths = computed(() => {
|
const parentPaths = computed(() => {
|
||||||
let parent = instance.parent;
|
let parent = instance.parent;
|
||||||
const paths: string[] = [instance.props.path as string];
|
const paths: string[] = [instance.props.path as string];
|
||||||
while (parent?.type.name !== 'Menu') {
|
while (parent?.type.name !== 'MenuUI') {
|
||||||
if (parent?.props.path) {
|
if (parent?.props.path) {
|
||||||
paths.unshift(parent.props.path as string);
|
paths.unshift(parent.props.path as string);
|
||||||
}
|
}
|
||||||
|
|
@ -27,7 +27,7 @@ function useMenu() {
|
||||||
});
|
});
|
||||||
|
|
||||||
const parentMenu = computed(() => {
|
const parentMenu = computed(() => {
|
||||||
return findComponentUpward(instance, ['Menu', 'SubMenu']);
|
return findComponentUpward(instance, ['MenuUI', 'SubMenu']);
|
||||||
});
|
});
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue