fixed Radio bug
fixed Radio bug
This commit is contained in:
parent
184dba1c8e
commit
578ca32537
6 changed files with 42 additions and 7 deletions
|
@ -219,9 +219,8 @@
|
|||
return false;
|
||||
}
|
||||
});
|
||||
// todo
|
||||
// this.$on('el.form.blur', this.onFieldBlur);
|
||||
// this.$on('el.form.change', this.onFieldChange);
|
||||
this.$on('on-form-blur', this.onFieldBlur);
|
||||
this.$on('on-form-change', this.onFieldChange);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
@ -140,9 +140,11 @@
|
|||
},
|
||||
handleBlur () {
|
||||
this.$emit('on-blur');
|
||||
this.$dispatch('on-form-blur', this.value);
|
||||
},
|
||||
handleChange (event) {
|
||||
this.$emit('on-change', event);
|
||||
this.$dispatch('on-form-change', this.value);
|
||||
},
|
||||
resizeTextarea () {
|
||||
const autosize = this.autosize;
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
const prefixCls = 'ivu-radio-group';
|
||||
|
||||
export default {
|
||||
name: 'radioGroup',
|
||||
props: {
|
||||
model: {
|
||||
type: [String, Number],
|
||||
|
@ -51,6 +52,7 @@
|
|||
this.model = data.value;
|
||||
this.updateModel();
|
||||
this.$emit('on-change', data.value);
|
||||
this.$dispatch('on-form-change', data.value);
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue