fixed Radio bug

fixed Radio bug
This commit is contained in:
梁灏 2017-01-04 11:03:22 +08:00
parent 184dba1c8e
commit 578ca32537
6 changed files with 42 additions and 7 deletions

View file

@ -62,6 +62,7 @@
}
},
ready () {
if (this.$parent && this.$parent.$options.name === 'radioGroup') this.group = true;
if (!this.group) {
this.updateModel();
}
@ -81,6 +82,8 @@
checked: this.checked
});
}
if (!this.group) this.$dispatch('on-form-change', this.selected);
},
updateModel () {
this.selected = this.checked;