fixed when selector is multiple mode error.

This commit is contained in:
郑敏 2018-06-07 14:57:22 +08:00
parent 78824cc259
commit 4403f97d44

View file

@ -351,7 +351,7 @@
});
});
}
let hasDefaultSelected = slotOptions.some(option => this.query === option.componentOptions.propsData.value);
let hasDefaultSelected = slotOptions.some(option => this.query === option.key);
for (let option of slotOptions) {
const cOptions = option.componentOptions;
@ -426,7 +426,7 @@
const {multiple, 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.value) this.query = value;
if (this.remote && this.value) this.query = Array.isArray(value) ? "" : value;
return initialValue.filter((item) => {
return Boolean(item) || item === 0;
});