From b29d82f4e75b41f7510c08d31d2d6ea384e30a08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=94=8C=E5=B0=8F=E5=AD=90?= <2252647301@qq.com> Date: Wed, 7 Aug 2024 15:45:48 +0800 Subject: [PATCH] fix(components): [select] equal objects cannot destroy instances (#17214) fix(components): [select] support value of type of object closed #17209 Co-authored-by: zhangdong Co-authored-by: qiang --- packages/components/select/src/useOption.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/components/select/src/useOption.ts b/packages/components/select/src/useOption.ts index e326676fb9..3c37bfe31a 100644 --- a/packages/components/select/src/useOption.ts +++ b/packages/components/select/src/useOption.ts @@ -1,6 +1,6 @@ // @ts-nocheck import { computed, getCurrentInstance, inject, toRaw, watch } from 'vue' -import { get, isEqual } from 'lodash-unified' +import { get } from 'lodash-unified' import { ensureArray, escapeStringRegexp, isObject } from '@element-plus/utils' import { selectGroupKey, selectKey } from './token' @@ -78,7 +78,7 @@ export function useOption(props, states) { (val, oldVal) => { const { remote, valueKey } = select.props - if (!isEqual(val, oldVal)) { + if (val !== oldVal) { select.onOptionDestroy(oldVal, instance.proxy) select.onOptionCreate(instance.proxy) }