From 62bade4fdaa723d9272b030340d14c196701b1d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=93=9D=E6=A1=A5=E6=98=A5=E9=9B=AA?= <40554198+WangYJEE@users.noreply.github.com> Date: Tue, 12 Nov 2024 20:17:29 +0800 Subject: [PATCH] fix(components): [select & select-v2] status-icon is invalid (#18101) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix(components): [select & select-v2] The check result icon is still displayed when status-icon is false Co-authored-by: 蓝桥春雪 --- packages/components/select-v2/src/select.vue | 2 +- packages/components/select-v2/src/useSelect.ts | 3 +++ packages/components/select/src/select.vue | 2 +- packages/components/select/src/useSelect.ts | 3 +++ 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/components/select-v2/src/select.vue b/packages/components/select-v2/src/select.vue index d86a0ee3bf..d66f8bf892 100644 --- a/packages/components/select-v2/src/select.vue +++ b/packages/components/select-v2/src/select.vue @@ -229,7 +229,7 @@ diff --git a/packages/components/select-v2/src/useSelect.ts b/packages/components/select-v2/src/useSelect.ts index 7b8c0bb9b6..2187edf9fe 100644 --- a/packages/components/select-v2/src/useSelect.ts +++ b/packages/components/select-v2/src/useSelect.ts @@ -135,6 +135,8 @@ const useSelect = (props: ISelectV2Props, emit: SelectEmitFn) => { const selectDisabled = computed(() => props.disabled || elForm?.disabled) + const needStatusIcon = computed(() => elForm?.statusIcon ?? false) + const popupHeight = computed(() => { const totalHeight = filteredOptions.value.length * props.itemHeight return totalHeight > props.height ? props.height : totalHeight @@ -913,6 +915,7 @@ const useSelect = (props: ISelectV2Props, emit: SelectEmitFn) => { shouldShowPlaceholder, selectDisabled, selectSize, + needStatusIcon, showClearBtn, states, isFocused, diff --git a/packages/components/select/src/select.vue b/packages/components/select/src/select.vue index 5dfdd1a19e..303415171a 100644 --- a/packages/components/select/src/select.vue +++ b/packages/components/select/src/select.vue @@ -229,7 +229,7 @@ diff --git a/packages/components/select/src/useSelect.ts b/packages/components/select/src/useSelect.ts index 010981c38a..8aafb4186d 100644 --- a/packages/components/select/src/useSelect.ts +++ b/packages/components/select/src/useSelect.ts @@ -141,6 +141,8 @@ export const useSelect = (props: ISelectProps, emit) => { : !isEmptyValue(props.modelValue) }) + const needStatusIcon = computed(() => form?.statusIcon ?? false) + const showClose = computed(() => { return ( props.clearable && @@ -826,6 +828,7 @@ export const useSelect = (props: ISelectProps, emit) => { shouldShowPlaceholder, currentPlaceholder, mouseEnterEventName, + needStatusIcon, showClose, iconComponent, iconReverse,