fixed that check expected value status

This commit is contained in:
郑敏 2018-06-05 14:32:19 +08:00
parent 9ccd81961b
commit 73b01ee06b

View file

@ -230,9 +230,7 @@
}).filter(Boolean);
}
if (this.getInitialValue().length > 0 && this.selectOptions.length === 0){
this.hasExpectedValue = true;
}
this.checkUpdateStatus();
},
data () {
@ -632,15 +630,18 @@
},
updateSlotOptions(){
this.slotOptions = this.$slots.default;
},
checkUpdateStatus() {
if (this.getInitialValue().length > 0 && this.selectOptions.length === 0) {
this.hasExpectedValue = true;
}
}
},
watch: {
value(value){
const {getInitialValue, getOptionData, publicValue} = this;
if (getInitialValue().length > 0) {
this.hasExpectedValue = true
}
this.checkUpdateStatus();
if (value === '') this.values = [];
else if (JSON.stringify(value) !== JSON.stringify(publicValue)) {