mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2024-12-21 04:50:14 +08:00
fix(select): emit-option with normalized option
This commit is contained in:
parent
8963a9a61f
commit
6ce780ae7b
@ -353,6 +353,14 @@ export default {
|
||||
return option.value === this.value
|
||||
}
|
||||
},
|
||||
normalizeOption (option) {
|
||||
const normalizedOption = {
|
||||
label: option.label,
|
||||
value: option.value,
|
||||
disabled: option.disabled
|
||||
}
|
||||
return normalizedOption
|
||||
},
|
||||
/**
|
||||
* event utils methods
|
||||
*/
|
||||
@ -363,11 +371,11 @@ export default {
|
||||
this.$emit('change', null)
|
||||
} else {
|
||||
let options = this.mapValuesToOptions(newValue)
|
||||
this.$emit('change', options)
|
||||
this.$emit('change', options.map(this.normalizeOption))
|
||||
}
|
||||
} else {
|
||||
const option = this.getOption(newValue)
|
||||
this.$emit('change', option)
|
||||
this.$emit('change', this.normalizeOption(option))
|
||||
}
|
||||
} else {
|
||||
this.$emit('change', newValue)
|
||||
|
Loading…
Reference in New Issue
Block a user