mirror of https://github.com/ElemeFE/element
Form: 🔧 fixed validation issue with dynamic rules (fixed #1317)
parent
75d248e107
commit
bfab5cd9ed
|
@ -23,6 +23,11 @@
|
||||||
},
|
},
|
||||||
inline: Boolean
|
inline: Boolean
|
||||||
},
|
},
|
||||||
|
watch: {
|
||||||
|
rules() {
|
||||||
|
this.validate();
|
||||||
|
}
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
fields: []
|
fields: []
|
||||||
|
@ -54,7 +59,7 @@
|
||||||
if (errors) {
|
if (errors) {
|
||||||
valid = false;
|
valid = false;
|
||||||
}
|
}
|
||||||
if (index === this.fields.length - 1) {
|
if (typeof callback === 'function' && index === this.fields.length - 1) {
|
||||||
callback(valid);
|
callback(valid);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue