This commit is contained in:
梁灏 2018-12-27 11:53:47 +08:00
parent abb82debb8
commit 07201151da

View file

@ -761,21 +761,12 @@
}, },
slotOptions(options, old){ slotOptions(options, old){
// #4626 Options label v-model // #4626 Options label v-model
if (this.flatOptions && this.flatOptions.length && this.values.length && !this.multiple && !this.remote) { // remote getInitialValue bug
this.values = this.values.map(value => { if (!this.remote) {
const option = this.flatOptions.find(option => { const values = this.getInitialValue();
if (!option.componentOptions) return false; if (this.flatOptions && this.flatOptions.length && values.length && !this.multiple) {
return option.componentOptions.propsData.value === value.value; this.values = values.map(this.getOptionData).filter(Boolean);
}); }
if(!option) return null;
const label = getOptionLabel(option);
return {
value: value.value,
label: label
};
}).filter(Boolean);
} }
// dropdown // dropdown