fix #5090
This commit is contained in:
parent
abb82debb8
commit
07201151da
1 changed files with 6 additions and 15 deletions
|
@ -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 在控件上部显示时,如果选项列表的长度由外部动态变更了,
|
||||||
|
|
Loading…
Add table
Reference in a new issue