mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-11-29 17:58:08 +08:00
fix(components): [select] getValueIndex empty error (#18867)
* fix(components): [select] getValueIndex judgment error * feat: update
This commit is contained in:
parent
a88ace35ba
commit
84f5d6f13a
@ -589,7 +589,8 @@ export const useSelect = (props: ISelectProps, emit) => {
|
||||
}
|
||||
|
||||
const getValueIndex = (arr: any[] = [], option) => {
|
||||
if (!isObject(option?.value)) return arr.indexOf(option.value)
|
||||
if (isUndefined(option)) return -1
|
||||
if (!isObject(option.value)) return arr.indexOf(option.value)
|
||||
|
||||
return arr.findIndex((item) => {
|
||||
return isEqual(get(item, props.valueKey), getValueKey(option))
|
||||
|
Loading…
Reference in New Issue
Block a user