From f78cc319aba0f0482b44bd261e97712b1f9bf7c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?jackhoo=28=E8=83=A1=E5=BD=AA=29?= <1679575151@qq.com> Date: Thu, 31 Oct 2024 22:05:51 +0800 Subject: [PATCH] fix(@vben-core/menu-ui): fix horizontal layout top menu language switching issue(#4724) (#4777) Co-authored-by: jackhoo_98 --- packages/@core/ui-kit/menu-ui/src/components/menu.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 004300a16..ea7a14c05 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