mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2025-01-18 12:34:25 +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: {
|
watch: {
|
||||||
|
options () {
|
||||||
|
this.$nextTick().then(this.updateMemorizedOptions)
|
||||||
|
},
|
||||||
filteredOptions () {
|
filteredOptions () {
|
||||||
this.$nextTick().then(() => {
|
this.$nextTick().then(() => {
|
||||||
this.updatePosition()
|
this.updatePosition()
|
||||||
@ -221,6 +224,13 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
|
this.updateMemorizedOptions()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/**
|
||||||
|
* remote related methods
|
||||||
|
*/
|
||||||
|
updateMemorizedOptions () {
|
||||||
if (this.remote && this.multiple) {
|
if (this.remote && this.multiple) {
|
||||||
for (const option of this.selectedOptions) {
|
for (const option of this.selectedOptions) {
|
||||||
this.memorizedValueOptionMap.set(option.value, option)
|
this.memorizedValueOptionMap.set(option.value, option)
|
||||||
@ -232,7 +242,6 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
|
||||||
/**
|
/**
|
||||||
* menu related methods
|
* menu related methods
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user