fix(components): [select-v2] resolve overlap of tags and placeholder (#18388)

* fix(components): [select-v2] resolve overlap of tags and placeholder

closed #18382

* Update packages/components/select-v2/src/useSelect.ts

ok

Co-authored-by: btea <2356281422@qq.com>

---------

Co-authored-by: btea <2356281422@qq.com>
This commit is contained in:
Manshu Tusker 2024-11-14 21:24:48 +08:00 committed by GitHub
parent 343cacf5cc
commit 0cc526e1c1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -814,9 +814,11 @@ const useSelect = (props: ISelectV2Props, emit: SelectEmitFn) => {
watch(
() => props.modelValue,
(val, oldVal) => {
const isValEmpty = !val || (isArray(val) && val.length === 0)
if (
!val ||
(props.multiple && val.toString() !== states.previousValue) ||
isValEmpty ||
(props.multiple && !isEqual(val.toString(), states.previousValue)) ||
(!props.multiple &&
getValueKey(val) !== getValueKey(states.previousValue))
) {