-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
Prop cross-validation #3254
Labels
✨ feature request
New feature or request
Comments
It wasn't possible in Vue 2 (vuejs/vue#6787) but I think this would be really helpful |
Amazing ❤️ |
nandi95
added a commit
to nandi95/vue-next
that referenced
this issue
Sep 28, 2021
Added all props to the prop validator as a second argument vuejs#3254
I think this can be closed now since #3258 has been merged and released as part of v3.4 |
Weird this didn't auto close once the change went into |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
What problem does this feature solve?
This issue I had frequently in vue 2 as well but never really questioned it.
Is there a reason why the prop validator doesn't have access to the other props? If so I could not find any related discussion.
This would be very helpful if I would like to validate a prop one way if another prop is present, and another way if it isn't.
As far as I can tell the props can be passed to the validateProp from here
There is currently a workaround using watchers, but in my opinion that isn't as clean as this would be.
I would be happy to PR this if wanted.
What does the proposed API look like?
The text was updated successfully, but these errors were encountered: