fix(components): [el-select] first item hover status error (#3880)

Co-authored-by: “Alanscut” <“wp_scut@163.com”>
This commit is contained in:
Alan Wang 2021-11-05 18:40:07 +08:00 committed by GitHub
parent 9c74c8595a
commit 07353a13e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -480,10 +480,7 @@ export const useSelect = (props, states: States, ctx) => {
const valueKey = props.valueKey
if (!props.multiple) {
states.hoverIndex = optionsArray.value.findIndex((item) => {
return (
getValueByPath(item, valueKey) ===
getValueByPath(states.selected, valueKey)
)
return getValueKey(item) === getValueKey(states.selected)
})
} else {
if (states.selected.length > 0) {