chore: improve form warning (#3641)
parent
53f3950b81
commit
4e4b9d6cca
|
@ -75,10 +75,15 @@ async function validateRule(
|
||||||
subRuleField = cloneRule.defaultField;
|
subRuleField = cloneRule.defaultField;
|
||||||
delete 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(
|
warning(
|
||||||
false,
|
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