feat(Form): add validate-trigger prop

This commit is contained in:
陈嘉涵
2020-02-19 17:25:30 +08:00
parent 7154afb36f
commit c08db724a3
6 changed files with 89 additions and 9 deletions
+9 -4
View File
@@ -7,15 +7,20 @@ export const FieldMixin = {
watch: {
value() {
if (this.vanField) {
this.vanField.resetValidation();
const field = this.vanField;
if (field) {
field.resetValidation();
field.validateWithTrigger('onChange');
}
},
},
created() {
if (this.vanField && !this.vanField.children) {
this.vanField.children = this;
const field = this.vanField;
if (field && !field.children) {
field.children = this;
}
},
};