Merge pull request #3498 from Superman379/patch-2

修复RadioGroup只能在使用v-model绑定的情况下才能正常使用的bug。
This commit is contained in:
Aresn 2018-05-03 11:46:22 +08:00 committed by GitHub
commit 37322f8211
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -67,7 +67,7 @@
this.childrens = findComponentsDownward(this, 'Radio'); this.childrens = findComponentsDownward(this, 'Radio');
if (this.childrens) { if (this.childrens) {
this.childrens.forEach(child => { this.childrens.forEach(child => {
child.currentValue = this.value === child.label; child.currentValue = this.currentValue === child.label;
child.group = true; child.group = true;
}); });
} }
@ -82,8 +82,10 @@
}, },
watch: { watch: {
value () { value () {
this.currentValue = this.value; if(this.currentValue !== this.value){
this.updateValue(); this.currentValue = this.value;
this.updateValue();
}
} }
} }
}; };