<!--- 1. 提问前务必先搜索issue,查看是否已有类似问题。 1. try searching for similar issues before reporting yours 2. 非bug or feature类问题,欢迎加入我们的开源社区钉钉群进行讨论。 --> **1.依赖仓库的版本(Dependencies versions)**: - react:17.0.2 - form-render:2.2.13 - table-render: 未引入 - antd:4.18.9 **2.问题描述(Bug description)**: scheme的description不是空的时候,表单的validateMessages取得就不是label了,取得是name **3.出现问题的 schema demo(Reproduction schema demo)**: ```js const schema = { } ``` **4.最小复现 demo(Reproduction demo)**: <!-- 请尽可能提供复现demo,有 demo 的 bug report 会在第一时间处理 Please provide reproduction of your bug. Bug report with reproduction demo will be dealt first --> form-render demo https://codesandbox.io/s/unruffled-flower-jl78h table-render demo https://codesandbox.io/s/sweet-euler-bdoty fr-generator demo https://codesandbox.io/s/s13sh
Activity
guomh commentedon Jul 24, 2026
可以用validateMessages 这个参数覆盖校验失败的提示信息
const validateMessages = {
default: '未通过校验',
required: '此项必填',
whitespace: '不能为空',
date: {
format: '格式错误',
parse: '无法被解析',
invalid: '数据不合法',
},
types: {
string: '数据类型必须是 string',
method: '数据类型必须是 method',
array: '数据类型必须是 array',
object: '数据类型必须是 object',
number: '数据类型必须是 number',
date: '数据类型必须是 date',
boolean: '数据类型必须是 boolean',
integer: '数据类型必须是 integer',
float: '数据类型必须是 float',
regexp: '数据类型必须是 regexp',
email: '数据类型必须是 email',
url: '数据类型必须是 url',
hex: '数据类型必须是 hex',
},
string: {
len: '长度不是${len}',
min: '长度不能小于${min}',
max: '长度不能大于${max}',
range: '长度需在${min}与${max}之间',
},
number: {
len: '不等于${len}',
min: '不能小于${min}',
max: '不能大于${max}',
range: '需在${min}与${max}之间',
},
array: {
len: '长度不是${len}',
min: '长度不能小于${min}',
max: '长度不能大于${max}',
range: '长度需在${min}与${max}之间',
},
pattern: {
mismatch: '未通过正则判断${pattern}',
},
};
philousWen commentedon Jul 24, 2026