mirror of
https://github.com/element-plus/element-plus.git
synced 2026-03-13 07:51:17 +08:00
fix(components): [select-v2] label error when value not in the options (#14656)
closed #14621
This commit is contained in:
@@ -478,7 +478,7 @@ describe('Select', () => {
|
||||
[undefined, DEFAULT_PLACEHOLDER],
|
||||
['', ''],
|
||||
[[], DEFAULT_PLACEHOLDER],
|
||||
[{}, '[object Object]'],
|
||||
[{}, ''],
|
||||
])(
|
||||
'[single select] initial value is %s, placeholder is "%s"',
|
||||
async (value, placeholder) => {
|
||||
|
||||
@@ -700,7 +700,7 @@ const useSelect = (props: ISelectProps, emit) => {
|
||||
states.selectedLabel = getLabel(options[selectedItemIndex])
|
||||
updateHoveringIndex(selectedItemIndex)
|
||||
} else {
|
||||
states.selectedLabel = `${props.modelValue}`
|
||||
states.selectedLabel = getValueKey(props.modelValue)
|
||||
}
|
||||
} else {
|
||||
states.selectedLabel = ''
|
||||
|
||||
Reference in New Issue
Block a user