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: { watch: {
value() { value() {
this.resetValidate();
this.$nextTick(this.adjustSize); 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) { format(target = this.$refs.input) {
if (!target) { if (!target) {
return; return;

View File

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