fixed #3817 that the default value does't display bug.

This commit is contained in:
郑敏 2018-06-07 14:06:30 +08:00
parent fdc71ffe95
commit 78824cc259

View file

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