diff --git a/packages/@core/ui-kit/menu-ui/src/components/menu.vue b/packages/@core/ui-kit/menu-ui/src/components/menu.vue index 004300a16e4..ea7a14c05ee 100644 --- a/packages/@core/ui-kit/menu-ui/src/components/menu.vue +++ b/packages/@core/ui-kit/menu-ui/src/components/menu.vue @@ -64,7 +64,6 @@ const activePath = ref(props.defaultActive); const items = ref({}); const subMenus = ref({}); const mouseInChild = ref(false); -const defaultSlots: VNodeArrayChildren = slots.default?.() ?? []; const isMenuPopup = computed(() => { return ( @@ -73,6 +72,9 @@ const isMenuPopup = computed(() => { }); const getSlot = computed(() => { + // 更新插槽内容 + const defaultSlots: VNodeArrayChildren = slots.default?.() ?? []; + const originalSlot = flattedChildren(defaultSlots) as VNodeArrayChildren; const slotDefault = sliceIndex.value === -1