fix(Form): reset validate when checkbox changed

This commit is contained in:
陈嘉涵 2020-02-10 11:04:03 +08:00
parent e17a4a2499
commit 494e303061
2 changed files with 15 additions and 4 deletions

View File

@ -63,11 +63,8 @@ export default createComponent({
watch: {
value() {
this.resetValidate();
this.$nextTick(this.adjustSize);
if (this.validateMessage) {
this.validateMessage = '';
}
},
},
@ -154,6 +151,12 @@ export default createComponent({
});
},
resetValidate() {
if (this.validateMessage) {
this.validateMessage = '';
}
},
format(target = this.$refs.input) {
if (!target) {
return;

View File

@ -5,6 +5,14 @@ export const FieldMixin = {
},
},
watch: {
value() {
if (this.vanField) {
this.vanField.resetValidate();
}
},
},
created() {
if (this.vanField) {
this.vanField.children = this;