diff --git a/components/form/utils/validateUtil.ts b/components/form/utils/validateUtil.ts index 7cd9c5d4d..88f1504eb 100644 --- a/components/form/utils/validateUtil.ts +++ b/components/form/utils/validateUtil.ts @@ -75,6 +75,12 @@ async function validateRule( subRuleField = cloneRule.defaultField; delete cloneRule.defaultField; } + if (!rule.type && typeof rule.validator !== 'function' && typeof value !== 'string') { + warning( + false, + `Form rules must provide type property when validating a value which is not string type`, + ); + } const validator = new AsyncValidator({ [name]: [cloneRule],