From f15b6f7ca3c2447f894192c5c7281d34ed9e7028 Mon Sep 17 00:00:00 2001 From: Jeff Sagal Date: Tue, 19 Oct 2021 15:25:53 -0700 Subject: [PATCH] Squashed commit of the following: commit e8d7abbf33417c843716d7cff1f50e92447a5341 Author: Jeff Sagal Date: Mon Oct 18 13:35:36 2021 -0700 refactor: use an immediate watcher instead of created hook for reduce (#1523) --- src/components/Select.vue | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/components/Select.vue b/src/components/Select.vue index be11e98..47f810d 100644 --- a/src/components/Select.vue +++ b/src/components/Select.vue @@ -932,10 +932,13 @@ export default { * Make sure to update internal * value if prop changes outside */ - value(val) { - if (this.isTrackingValues) { - this.setInternalValueFromOptions(val) - } + value: { + immediate: true, + handler(val) { + if (this.isTrackingValues) { + this.setInternalValueFromOptions(val) + } + }, }, /** @@ -955,10 +958,6 @@ export default { created() { this.mutableLoading = this.loading - if (typeof this.value !== 'undefined' && this.isTrackingValues) { - this.setInternalValueFromOptions(this.value) - } - this.$on('option:created', this.pushTag) },