mirror of https://github.com/ElemeFE/element
Form: rule key supports both dot-separated and nested (#10227)
parent
4abeadb7c1
commit
a294c628e9
|
@ -235,7 +235,8 @@
|
||||||
const selfRules = this.rules;
|
const selfRules = this.rules;
|
||||||
const requiredRule = this.required !== undefined ? { required: !!this.required } : [];
|
const requiredRule = this.required !== undefined ? { required: !!this.required } : [];
|
||||||
|
|
||||||
formRules = formRules ? getPropByPath(formRules, this.prop || '').o[this.prop || ''] : [];
|
const prop = getPropByPath(formRules, this.prop || '');
|
||||||
|
formRules = formRules ? (prop.o[this.prop || ''] || prop.v) : [];
|
||||||
|
|
||||||
return [].concat(selfRules || formRules || []).concat(requiredRule);
|
return [].concat(selfRules || formRules || []).concat(requiredRule);
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue