Skip to content

Commit 5d2044c

Browse files
committed
fix(Form): add array required judge
Closes #148
1 parent d802666 commit 5d2044c

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/components/form-item/formItem.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ export default {
9797
computed: {
9898
configRequired() {
9999
if (!this.prop) return false;
100-
return this.requireds.indexOf(this.prop) > -1;
100+
const ruleKey = this.prop.replace(/\[\w+\]/, '[]');
101+
return this.requireds.indexOf(this.prop) > -1 || this.requireds.indexOf(ruleKey) > -1;
101102
},
102103
initLabelWidth() {
103104
let mode = this.params.mode;

0 commit comments

Comments
 (0)