mirror of
https://gitee.com/ant-design-vue/ant-design-vue.git
synced 2024-12-02 20:18:22 +08:00
chore: improve form warning (#3641)
This commit is contained in:
parent
53f3950b81
commit
4e4b9d6cca
@ -75,10 +75,15 @@ async function validateRule(
|
||||
subRuleField = cloneRule.defaultField;
|
||||
delete cloneRule.defaultField;
|
||||
}
|
||||
if (!rule.type && typeof rule.validator !== 'function' && typeof value !== 'string') {
|
||||
if (
|
||||
!rule.type &&
|
||||
typeof rule.validator !== 'function' &&
|
||||
typeof value !== 'string' &&
|
||||
typeof value !== 'undefined'
|
||||
) {
|
||||
warning(
|
||||
false,
|
||||
`Form rules must provide type property when validating a value which is not string type`,
|
||||
`Form rules must provide type property when validating the form item named [${name}] which is not string type`,
|
||||
);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user