From c741fa2ff18546ebe90cc6b5e57829a3cc4815d9 Mon Sep 17 00:00:00 2001 From: Sergio Crisostomo Date: Fri, 15 Jun 2018 11:10:11 +0200 Subject: [PATCH] Use label as query --- src/components/select/select.vue | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/select/select.vue b/src/components/select/select.vue index d09dd7e4..bc7ca020 100644 --- a/src/components/select/select.vue +++ b/src/components/select/select.vue @@ -423,10 +423,13 @@ }; }, getInitialValue(){ - const {multiple, value} = this; + const {multiple, remote, value} = this; let initialValue = Array.isArray(value) ? value : [value]; if (!multiple && (typeof initialValue[0] === 'undefined' || (String(initialValue[0]).trim() === '' && !Number.isFinite(initialValue[0])))) initialValue = []; - if (this.remote && !this.multiple && this.value) this.query = value; + if (remote && !multiple && value) { + const data = this.getOptionData(value); + this.query = data ? data.label : String(value); + } return initialValue.filter((item) => { return Boolean(item) || item === 0; });