mirror of
https://gitee.com/wot-design-uni/wot-design-uni.git
synced 2025-12-06 17:18:40 +08:00
fix: 🐛 修复 drop-menu-item 有选项值为空字符串时导致新值错误并触发组件内部警告的问题
This commit is contained in:
parent
6f12aa4b04
commit
f63de5bd1d
@ -128,9 +128,10 @@ function choose(index: number) {
|
||||
if (props.disabled) return
|
||||
const { valueKey } = props
|
||||
const item = props.options[index]
|
||||
emit('update:modelValue', item[valueKey] !== '' && item[valueKey] !== undefined ? item[valueKey] : item)
|
||||
const newValue = item[valueKey] !== undefined ? item[valueKey] : item
|
||||
emit('update:modelValue', newValue)
|
||||
emit('change', {
|
||||
value: item[valueKey] !== '' && item[valueKey] !== undefined ? item[valueKey] : item,
|
||||
value: newValue,
|
||||
selectedItem: item
|
||||
})
|
||||
close()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user