This commit is contained in:
郑敏 2018-06-03 23:18:29 +08:00
parent ed4bb14303
commit 0fb9d6453a

View file

@ -230,8 +230,8 @@
}).filter(Boolean); }).filter(Boolean);
} }
if (this.values.length > 0 && this.selectOptions.length === 0){ if (this.getInitialValue().length > 0 && this.selectOptions.length === 0){
this.hasExpectedValue = this.values; this.hasExpectedValue = true;
} }
}, },
data () { data () {
@ -716,7 +716,10 @@
this.broadcast('Drop', open ? 'on-update-popper' : 'on-destroy-popper'); this.broadcast('Drop', open ? 'on-update-popper' : 'on-destroy-popper');
}, },
selectOptions(){ selectOptions(){
if (this.hasExpectedValue){ if (this.hasExpectedValue && this.selectOptions.length > 0){
if (this.values.length === 0) {
this.values = this.getInitialValue();
}
this.values = this.values.map(this.getOptionData).filter(Boolean); this.values = this.values.map(this.getOptionData).filter(Boolean);
this.hasExpectedValue = false; this.hasExpectedValue = false;
} }