fix(components): [select & select-v2] status-icon is invalid (#18101)

fix(components): [select & select-v2] The check result icon is still displayed when status-icon is false

Co-authored-by: 蓝桥春雪 <yj.wang3@sinitek.com>
This commit is contained in:
蓝桥春雪 2024-11-12 20:17:29 +08:00 committed by GitHub
parent a9e6345464
commit 62bade4fda
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 8 additions and 2 deletions

View File

@ -229,7 +229,7 @@
<component :is="clearIcon" />
</el-icon>
<el-icon
v-if="validateState && validateIcon"
v-if="validateState && validateIcon && needStatusIcon"
:class="[nsInput.e('icon'), nsInput.e('validateIcon')]"
>
<component :is="validateIcon" />

View File

@ -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,

View File

@ -229,7 +229,7 @@
<component :is="clearIcon" />
</el-icon>
<el-icon
v-if="validateState && validateIcon"
v-if="validateState && validateIcon && needStatusIcon"
:class="[nsInput.e('icon'), nsInput.e('validateIcon')]"
>
<component :is="validateIcon" />

View File

@ -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,