From 07353a13e12fa2a113f83e5120c5a32a57ccaa39 Mon Sep 17 00:00:00 2001 From: Alan Wang Date: Fri, 5 Nov 2021 18:40:07 +0800 Subject: [PATCH] fix(components): [el-select] first item hover status error (#3880) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: “Alanscut” <“wp_scut@163.com”> --- packages/components/select/src/useSelect.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/components/select/src/useSelect.ts b/packages/components/select/src/useSelect.ts index 7aa1647db0..92c797759d 100644 --- a/packages/components/select/src/useSelect.ts +++ b/packages/components/select/src/useSelect.ts @@ -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) {