Merge pull request #3897 from SergioCrisostomo/select-patches
Use label as query
This commit is contained in:
commit
32dc136431
1 changed files with 5 additions and 2 deletions
|
@ -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;
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue