fix(select): options not memorized when options set async

This commit is contained in:
07akioni 2019-09-03 10:18:19 +08:00
parent 52286b1e5f
commit 726a9419d5

View File

@ -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
*/