-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
ValidationObserver invalid rules #1923
Comments
Whats keeping me for implementing this is the issue with how the Observers are going to represent that, for example, a provider has no conflict issues. But observers will have duplicate rules from different providers. In other words: <p v-if="what...">One of the two fields is required</p> What goes into that <p v-if="failedRules.one.required || failedRules.two.required">One of the two fields is required</p> Because providers Feel free to suggest how you would access the information you are requesting and I will see what I can do. |
Ok I got it! Maybe with a function we can prevent a getFailedRules(field: string | number): object // the failedRules object or an empty object <p v-if="getFailedRules('one').required || getFailedRules('two').required">One of the two fields is required</p> |
Just ran into this issue myself. One solution, if you want to avoid the |
Is your feature request related to a problem? Please describe.
The new invalid rule object (#1898) can be used also in the ValidationObserver.
For example, in a form, if I use the
required-if
rule I want to print only one error message, shared between the two fieldsDescribe the solution you'd like
Include the invalid rules object in ValidationObserver slot scope
Describe alternatives you've considered
Use
data
value to verify if a field is empty but that's easy only with required rule.Additional context
The text was updated successfully, but these errors were encountered: