2
0
mirror of https://github.com/tenrok/vue-select.git synced 2026-06-22 10:30:34 +03:00

refactor: use an immediate watcher instead of created hook for reduce (#1523)

This commit is contained in:
Jeff Sagal
2021-10-18 13:35:36 -07:00
committed by GitHub
parent dc9bb227aa
commit e8d7abbf33
+4 -5
View File
@@ -932,11 +932,14 @@ export default {
* Make sure to update internal * Make sure to update internal
* value if prop changes outside * value if prop changes outside
*/ */
value(val) { value: {
immediate: true,
handler(val) {
if (this.isTrackingValues) { if (this.isTrackingValues) {
this.setInternalValueFromOptions(val) this.setInternalValueFromOptions(val)
} }
}, },
},
/** /**
* Always reset the value when * Always reset the value when
@@ -955,10 +958,6 @@ export default {
created() { created() {
this.mutableLoading = this.loading this.mutableLoading = this.loading
if (typeof this.value !== 'undefined' && this.isTrackingValues) {
this.setInternalValueFromOptions(this.value)
}
this.$on('option:created', this.pushTag) this.$on('option:created', this.pushTag)
}, },