You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
The Vuelidate API exposes a useVuelidate function for creating a validation object, which is frequently given a rules object and reactive state to apply it to. This function does not seem to work with refs. However, Vue's own documentation recommends ref over reactive.
Describe the solution you'd like
This huge missed opportunity seems to stem from the fact that you can't use the value keyword inside your rules (as to my understanding). The perfect solution would be to remove all reserved keywords from rules and instead apply it indiscriminately.
Describe alternatives you've considered
This might be a big rewrite. A simpler alternative would be to rename vuelidate's OWN value property to $value, being more inline with their current naming scheme and requiring minimal changes from developers to update. This of course doesn't solve the underlying issue that rules has reserved keywords, but it would at least allow for objects who already use value (which are a lot) as their main accessor to be used by vuelidate.
In my personal option, the parameter positions of rules/values is backwards. If it was created to be values/rules , then you could define your values object (or lets say also allowing a direct ref, rather than being forced into always needing an object), then you could define your rules with intellisense. I find myself often times working backwards when using the current api. Although, this doesn't really pertain to this issue
You raise a good point with intellisense though. Vuelidate is great once it works, but I’ve already lost hours of time due to the intellisense issue alone. When it doesn’t work, I’m frantically trying to change everything until I realize oep, someone changed a type somewhere but everything still build correctly and nobody realized they needed to change the vuelidate schema. It’s incredibly frustrating.
If intellisense will not work with vuelidate, I would at least want it to throw an error so I can debug in the console. Right now it’s not giving me anything. It would have likely helped me out with this problem, too.
Is your feature request related to a problem? Please describe.
The Vuelidate API exposes a
useVuelidate
function for creating a validation object, which is frequently given a rules object and reactive state to apply it to. This function does not seem to work with refs. However, Vue's own documentation recommends ref over reactive.Describe the solution you'd like
This huge missed opportunity seems to stem from the fact that you can't use the
value
keyword inside your rules (as to my understanding). The perfect solution would be to remove all reserved keywords from rules and instead apply it indiscriminately.Describe alternatives you've considered
This might be a big rewrite. A simpler alternative would be to rename vuelidate's OWN
value
property to$value
, being more inline with their current naming scheme and requiring minimal changes from developers to update. This of course doesn't solve the underlying issue that rules has reserved keywords, but it would at least allow for objects who already usevalue
(which are a lot) as their main accessor to be used by vuelidate.Additional context
The text was updated successfully, but these errors were encountered: