Commit ffc310d9 authored by Leopoldthecoder's avatar Leopoldthecoder Committed by 杨奕

Form: support nested rules

parent 051b03f4
...@@ -226,7 +226,7 @@ ...@@ -226,7 +226,7 @@
var selfRules = this.rules; var selfRules = this.rules;
var requiredRule = this.required !== undefined ? { required: !!this.required } : []; var requiredRule = this.required !== undefined ? { required: !!this.required } : [];
formRules = formRules ? formRules[this.prop] : []; formRules = formRules ? getPropByPath(formRules, this.prop || '').v : [];
return [].concat(selfRules || formRules || []).concat(requiredRule); return [].concat(selfRules || formRules || []).concat(requiredRule);
}, },
...@@ -250,6 +250,7 @@ ...@@ -250,6 +250,7 @@
} }
}, },
mounted() { mounted() {
console.log(11, this.prop);
if (this.prop) { if (this.prop) {
this.dispatch('ElForm', 'el.form.addField', [this]); this.dispatch('ElForm', 'el.form.addField', [this]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment