mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2024-12-15 04:42:23 +08:00
fix(select): options not memorized when options set async
This commit is contained in:
parent
52286b1e5f
commit
726a9419d5
@ -200,6 +200,9 @@ export default {
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
options () {
|
||||
this.$nextTick().then(this.updateMemorizedOptions)
|
||||
},
|
||||
filteredOptions () {
|
||||
this.$nextTick().then(() => {
|
||||
this.updatePosition()
|
||||
@ -221,6 +224,13 @@ export default {
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
this.updateMemorizedOptions()
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* remote related methods
|
||||
*/
|
||||
updateMemorizedOptions () {
|
||||
if (this.remote && this.multiple) {
|
||||
for (const option of this.selectedOptions) {
|
||||
this.memorizedValueOptionMap.set(option.value, option)
|
||||
@ -232,7 +242,6 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* menu related methods
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user