diff --git a/src/components/select/select.vue b/src/components/select/select.vue index 2d515b2..6a524aa 100644 --- a/src/components/select/select.vue +++ b/src/components/select/select.vue @@ -478,22 +478,25 @@ setQuery (query) { if (!this.filterable) return; this.query = query; + }, + modelToQuery() { + if (!this.multiple && this.filterable && this.model) { + this.findChild((child) => { + if (this.model === child.value) { + if (child.label) { + this.query = child.label; + } else if (child.searchLabel) { + this.query = child.searchLabel; + } else { + this.query = child.value; + } + } + }); + } } }, compiled () { - if (!this.multiple && this.filterable && this.model) { - this.findChild((child) => { - if (this.model === child.value) { - if (child.label) { - this.query = child.label; - } else if (child.searchLabel) { - this.query = child.searchLabel; - } else { - this.query = child.value; - } - } - }); - } + this.modelToQuery() this.updateOptions(true); document.addEventListener('keydown', this.handleKeydown); @@ -521,6 +524,7 @@ }, watch: { model () { + this.modelToQuery() if (this.multiple) { if (this.slotChangeDuration) { this.slotChangeDuration = false; -- libgit2 0.21.4