logaretm / vee-validate

✅ Painless Vue forms
https://vee-validate.logaretm.com/v4
MIT License
10.73k stars 1.25k forks source link

Pass validation mode through `handleSubmit` #4813

Open felixgabler opened 1 month ago

felixgabler commented 1 month ago

Is your feature request related to a problem? Please describe.

We have a multi-step form that calls the function returned by handleSubmit to go to the next step. This triggers all the validations for the other pages even though they are only shown freshly then.

Describe the solution you'd like

I would expect the ability to pass the validation mode (mode: 'validated-only') through the handleSubmit and it being forwarded to the validate call in handleSubmit.

Describe alternatives you've considered

felixgabler commented 1 month ago

I just realized that validated-only also does not solve this. How can we make sure to only validate the fields that are currently in the schema?

logaretm commented 1 month ago

Can you set up a minimal reproduction for this? I believe the docs already have an example or two for multi-step forms where this isn't an issue.