Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] 希望Form能给一个自定义覆盖默认校验信息模板的props #306

Closed
alvin0216 opened this issue Apr 15, 2021 · 1 comment
Assignees

Comments

@alvin0216
Copy link

期望的新功能

比如我需要给 form 设置校验的模板 see https://ant-design.gitee.io/components/form-cn/#validateMessages

为什么(简述一下使用场景)

配置举例:

const validateMessages = {
  required: "'${label}' 是必选字段",
  // ...
};

<Form validateMessages={validateMessages}></Form>;

我只需要传入 required: true 我就不用在 rules 写自己的校验文本了

@FateRiddle FateRiddle changed the title [Feature] 如何给 form-render 里的 form 传递 props [Feature] 希望能给一个自定义覆盖默认校验信息模板的入口 Apr 15, 2021
@FateRiddle FateRiddle changed the title [Feature] 希望能给一个自定义覆盖默认校验信息模板的入口 [Feature] 希望能给一个自定义覆盖默认校验信息模板的props Apr 15, 2021
@FateRiddle FateRiddle changed the title [Feature] 希望能给一个自定义覆盖默认校验信息模板的props [Feature] 希望Form能给一个自定义覆盖默认校验信息模板的props Apr 15, 2021
@FateRiddle
Copy link
Contributor

新增 validateMessages 字段,用于覆盖默认的校验信息,详见文档

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants