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){
|
||||
// #4626,当 Options 的 label 更新时,v-model 的值未更新
|
||||
if (this.flatOptions && this.flatOptions.length && this.values.length && !this.multiple && !this.remote) {
|
||||
this.values = this.values.map(value => {
|
||||
const option = this.flatOptions.find(option => {
|
||||
if (!option.componentOptions) return false;
|
||||
return option.componentOptions.propsData.value === value.value;
|
||||
});
|
||||
|
||||
if(!option) return null;
|
||||
|
||||
const label = getOptionLabel(option);
|
||||
return {
|
||||
value: value.value,
|
||||
label: label
|
||||
};
|
||||
}).filter(Boolean);
|
||||
// remote 下,调用 getInitialValue 有 bug
|
||||
if (!this.remote) {
|
||||
const values = this.getInitialValue();
|
||||
if (this.flatOptions && this.flatOptions.length && values.length && !this.multiple) {
|
||||
this.values = values.map(this.getOptionData).filter(Boolean);
|
||||
}
|
||||
}
|
||||
|
||||
// 当 dropdown 在控件上部显示时,如果选项列表的长度由外部动态变更了,
|
||||
|
|
Loading…
Add table
Reference in a new issue