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
offer an alternative to v-model
to tag validatable Nodes
#2277
Comments
Unfortunately, that is very hard to achieve. Consider this example: <ValidationProvider>
<TextSearch @change="updateValue" />
<CategorySelector @change="limitScope" />
</ValidationProvider> Now from the provider's perspective, both are just VNodes. Nothing is special between those nodes, the I will think of something, like an attribute that can be used aside from the <ValidationProvider>
<TextSearch @change="updateValue" validateThis />
<CategorySelector @change="limitScope" />
</ValidationProvider> Feel free to suggest |
v-model
on VNode
to tag validatable inputs
v-model
on VNode
to tag validatable inputsv-model
to tag validatable Nodes
@logaretm This attribute can be named, i.e. |
For vuex usually, you could use setters with computed properties to avoid this problem. But I do find introducing an alternative a good idea. |
This would be helpful in my case, where I have complex form component that is managing multiple inputs:
As you can see right now I have to create a computed property and use The uniqueness of this situation is that I'm validating something that isn't directly tied to any single input. Perhaps, it would be nice to have a |
The Provider does not only need the node, but also its current value. Knowing the node will allow it to add all listeners needed to get the flags going and value syncing as well. And knowing the value it will determine when to validate, having a custom property to tag the node isn't enough, such property needs to also carry the value. Thanks to #2355 the provider should detect nodes with |
I'm having a similar problem, I want to prepopulate my form with existing data using the input value attrribute. But by adding v-model to the field means whatever is in the vue data overwrites the default value on pageload. The other work arround I've seen removes v-model and validates onInput - this is not ideal either as the form is invalid unless the user changes the fields.
|
Is your feature request related to a problem? Please describe.
In VeeValidate docs, it is clearly stated that if you are using ValidationProvider, the fields being validated must have a v-model directive. Unfortunately, this causes problems when using VeeValidate with Vuetify.
Here is the problem from Vuetify Github:
vuetifyjs/vuetify#6201
In short, Vuetify has a serious problem when dealing with large forms. When there are a lot
v-text-fields
withv-model
the performance is really bad. When user types something in the input, there is a noticeable lag, which gets bigger when a form is growing.The current workaround to that problem is to not use
v-model
and instead use:value
and@change
event on input like this:But ValidationProvider in VeeValidate requires v-model, so this not firing validation in VeeValidate.
Describe the solution you'd like
It would be awesome if VeeValidate worked with just events.
v-model
should not be required.Additional context
VeeValidate 2.0 worked really well without
v-model
. However in VeeValidate 3.0v-model
is required and this makes it really hard when using it with Vuetify.The text was updated successfully, but these errors were encountered: