Skip to content

Update ValidationRule message type #3163

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

Merged
merged 1 commit into from
Nov 13, 2020
Merged

Conversation

pastr
Copy link

@pastr pastr commented Nov 12, 2020

This is a ...

  • New feature
  • Bug fix
  • Site / document update
  • Component style update
  • TypeScript definition update
  • Refactoring
  • Code style optimization
  • Branch merge
  • Other (about what?)

What's the background?

The type of message comes from the library async-validator and it has been updated: https://github.com/yiminghe/async-validator/pull/251/files
This PR is to keep ant-design-vue up to date with that change.

Self Check before Merge

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • TypeScript definition is updated/provided or not needed
  • Changelog is provided or not needed

@tangjinzhou
Copy link
Member

but how to use func for message?
if user use func, how to render message?

@pastr
Copy link
Author

pastr commented Nov 12, 2020

You can already use it, it was just the type that wasn't up to date
You can see a basic example here: https://codesandbox.io/s/brave-microservice-gjb5y?file=/src/components/form-model-example.vue
The rules for name and region are using a function.
It's also useful when using vue-i18n, the doc of async-validator has a small example here:
https://github.com/yiminghe/async-validator#messages
Hopefully, this answers your questions :)

@tangjinzhou
Copy link
Member

👍 I got it, thank you for you pr.

@tangjinzhou tangjinzhou merged commit 388ed15 into vueComponent:master Nov 13, 2020
@pastr
Copy link
Author

pastr commented Nov 13, 2020

Thanks for your work!

@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants