Commit 0fb9d6453a317e5a8a7d589b3073f75df1541463

Authored by ้ƒ‘ๆ•
1 parent ed4bb143

fix bug #3795

Showing 1 changed file with 6 additions and 3 deletions   Show diff stats
src/components/select/select.vue
... ... @@ -230,8 +230,8 @@
230 230 }).filter(Boolean);
231 231 }
232 232  
233   - if (this.values.length > 0 && this.selectOptions.length === 0){
234   - this.hasExpectedValue = this.values;
  233 + if (this.getInitialValue().length > 0 && this.selectOptions.length === 0){
  234 + this.hasExpectedValue = true;
235 235 }
236 236 },
237 237 data () {
... ... @@ -716,7 +716,10 @@
716 716 this.broadcast('Drop', open ? 'on-update-popper' : 'on-destroy-popper');
717 717 },
718 718 selectOptions(){
719   - if (this.hasExpectedValue){
  719 + if (this.hasExpectedValue && this.selectOptions.length > 0){
  720 + if (this.values.length === 0) {
  721 + this.values = this.getInitialValue();
  722 + }
720 723 this.values = this.values.map(this.getOptionData).filter(Boolean);
721 724 this.hasExpectedValue = false;
722 725 }
... ...