Commit 32dc136431448044a72feca0692001890368fef0
Committed by
GitHub
Merge pull request #3897 from SergioCrisostomo/select-patches
Use label as query
Showing
1 changed file
with
5 additions
and
2 deletions
Show diff stats
src/components/select/select.vue
... | ... | @@ -423,10 +423,13 @@ |
423 | 423 | }; |
424 | 424 | }, |
425 | 425 | getInitialValue(){ |
426 | - const {multiple, value} = this; | |
426 | + const {multiple, remote, value} = this; | |
427 | 427 | let initialValue = Array.isArray(value) ? value : [value]; |
428 | 428 | if (!multiple && (typeof initialValue[0] === 'undefined' || (String(initialValue[0]).trim() === '' && !Number.isFinite(initialValue[0])))) initialValue = []; |
429 | - if (this.remote && !this.multiple && this.value) this.query = value; | |
429 | + if (remote && !multiple && value) { | |
430 | + const data = this.getOptionData(value); | |
431 | + this.query = data ? data.label : String(value); | |
432 | + } | |
430 | 433 | return initialValue.filter((item) => { |
431 | 434 | return Boolean(item) || item === 0; |
432 | 435 | }); | ... | ... |