[ant-design/ant-design] 表单的错误消息模板参数 `validateMessages` 应该支持 ${label} 参数 (#22634)

From: notifications@github.com
Domain: IP info github.com
MX-server: IP info out-5.smtp.github.com
Size: 2211 Bytes
Create: 2020-03-26
Update: 2020-03-27
Score: 3
Safe: Yes

Outbound domains: github.com |

  • I have searched the issues of this repository and believe that this is not a duplicate.

What problem does this feature solve?

目前消息模板只支持几个有限的字段,其中 name 字段很让人不解,如果需要友好的用户提示,一定是需要使用 label 字段加上对应的消息,才能够方便用户理解。

例如在 <Form.Item name="username" label="用户名" rules={[{required: true]}/> 以这个参数为例,当参数校验失败时,更希望能够输出
用户名不得为空 , 而不是 username 不得为空 ,然而在当前的全局消息模板配置中无法实现这样的效果。

What does the proposed API look like?

<ConfigProvider/> 全局配置中, form.validateMessages 选项内可以使用 ${label} 参数

You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

Want to protect your real email from messages like this? Use TempM email and be more secure on the internet.