fix(select-option-collector): avoid depdency loops

This commit is contained in:
07akioni 2019-12-30 23:13:06 +08:00
parent f18af716ad
commit 63ac276a87
2 changed files with 11 additions and 1 deletions

View File

@ -31,7 +31,8 @@ export default {
return {
options: [],
isDestroying: false,
isMounting: true
isMounting: true,
isUpdatingOptions: false
}
},
computed: {
@ -53,6 +54,14 @@ export default {
this.isMounting = false
this.collectOptions()
},
updated () {
if (!this.isUpdatingOptions) {
this.isUpdatingOptions = true
this.collectOptions()
} else {
this.isUpdatingOptions = false
}
},
beforeDestroy () {
this.isDestroying = true
},

View File

@ -22,6 +22,7 @@
<n-base-select-menu
v-if="active"
ref="contentInner"
auto-pending-first-option
class="n-select-menu"
:theme="synthesizedTheme"
:pattern="value"