From 725214980496d62c3aefe892e3411edabe6a2677 Mon Sep 17 00:00:00 2001 From: tangjinzhou <415800467@qq.com> Date: Fri, 28 Oct 2022 09:06:22 +0800 Subject: [PATCH] fix: error when menu key dynamic, close #6057 --- components/menu/src/Menu.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/menu/src/Menu.tsx b/components/menu/src/Menu.tsx index 006025fc8..f695d2653 100644 --- a/components/menu/src/Menu.tsx +++ b/components/menu/src/Menu.tsx @@ -339,7 +339,7 @@ export default defineComponent({ }; const onInternalOpenChange = (key: Key, open: boolean) => { - const childrenEventKeys = keyMapStore.value[key].childrenEventKeys; + const childrenEventKeys = keyMapStore.value[key]?.childrenEventKeys || []; let newOpenKeys = mergedOpenKeys.value.filter(k => k !== key); if (open) {