From dd063b8275f4907493152dc5f12d283ff85b6e2a Mon Sep 17 00:00:00 2001 From: zkwolf Date: Tue, 28 Feb 2023 10:25:46 +0800 Subject: [PATCH] fix(dropdown): open invalid (#6316) --- components/dropdown/dropdown.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/components/dropdown/dropdown.tsx b/components/dropdown/dropdown.tsx index 5e0b463b9..1fc02a71e 100644 --- a/components/dropdown/dropdown.tsx +++ b/components/dropdown/dropdown.tsx @@ -139,6 +139,10 @@ const Dropdown = defineComponent({ return placement; }); + const mergedVisible = computed(() => { + return typeof props.visible === 'boolean' ? props.visible : props.open; + }); + const handleVisibleChange = (val: boolean) => { emit('update:visible', val); emit('visibleChange', val); @@ -183,6 +187,7 @@ const Dropdown = defineComponent({ { ...props, ...attrs, + visible: mergedVisible.value, builtinPlacements, overlayClassName: overlayClassNameCustomized, arrow: !!arrow,