V4 how to reproduce eager behaviour ? #3582
-
Hello, EDIT: ok i found in the doc that i need to use useField, first need to learn composition API so :p i am migrating from V3 to V4 and i have to say that i am quite lost with this new version. I'm having hard time to migrate some stuffs from v3 to V4 and i have a few questions below. For information, i'm using Quasar. In v3, i was happy with mode="eager" but i can't reproduce it in v4. So far, i'm stuck with this:
So it's kind of lazy but not eager for sure. For memory, eager is this:
Is it possible to reproduce eager in v4 ? Second point.
So the message was directly linked to the error (using my own translation file). From what i understand, it's now impossible to modify the vee validate rule so in V4, i did this:
It's working but is it ok to do it like this? Thanks a lot for your help and for your work on this nice plugin |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hello, actually i'm unable to reproduce the eager behaviour with Quasar : ( In your example, you use the native v-on behaviour with but with Quasar it's not working. In your example here : validationListeners is called at each keystroke when it's in aggressive mode. Below is my code with Quasar, and the validationListeners is not called on each keystroke and so validation is not happening (only when the field is losing the focus).
I tried many configurations but none worked, @logaretm maybe do you have a hint about this? Thanks a lot for your help. |
Beta Was this translation helpful? Give feedback.
-
It depends on the events emitted by the Here is an example: Note that handle change accepts a second argument to prevent validation on value change, given you configured the field to not validate on value change with |
Beta Was this translation helpful? Give feedback.
It depends on the events emitted by the
q-input
, most components emitblur
andupdate:modelValue
so you can focus on these only.Here is an example:
https://codesandbox.io/s/vee-validate-v4-with-quasar-framework-forked-5ti8j?file=/src/components/QInputWithValidation.vue
Note that handle change accepts a second argument to prevent validation on value change, given you configured the field to not validate on value change with
useField
.