Skip to content

Commit 4e4b9d6

Browse files
authored
chore: improve form warning (#3641)
1 parent 53f3950 commit 4e4b9d6

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

components/form/utils/validateUtil.ts

+7-2
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,15 @@ async function validateRule(
7575
subRuleField = cloneRule.defaultField;
7676
delete cloneRule.defaultField;
7777
}
78-
if (!rule.type && typeof rule.validator !== 'function' && typeof value !== 'string') {
78+
if (
79+
!rule.type &&
80+
typeof rule.validator !== 'function' &&
81+
typeof value !== 'string' &&
82+
typeof value !== 'undefined'
83+
) {
7984
warning(
8085
false,
81-
`Form rules must provide type property when validating a value which is not string type`,
86+
`Form rules must provide type property when validating the form item named [${name}] which is not string type`,
8287
);
8388
}
8489

0 commit comments

Comments
 (0)