victorgarciaesgi / regle

📏 Typescript first model-based form validation library for Vue 3
https://regle.vercel.app
MIT License
11 stars 0 forks source link

`$validate()` does not show error messages #13

Open martinszeltins opened 4 hours ago

martinszeltins commented 4 hours ago

It seems like r$.$validate() does not work. It doesn't show any validation messages. I have set autoDirty: false. I also noticed that there is another method called r$.$parse() which does show error messages. It is confusing. It is not clear what exactly the difference between $parse and $validate is.

Reproduction: https://stackblitz.com/~/github.com/martinszeltins/regle-test-7

Here you can see that when I click on Save which calls r$.validate() nothing happens. I expected the form to be validated and the error messages to show up.

Screencast:

https://github.com/user-attachments/assets/8e77a2aa-7cf5-4da0-ae3a-1a9977381ba3

victorgarciaesgi commented 3 hours ago

That will be fixed in next release!

$parse is better to use because it will also return the result of the validation and a type safe output of your form. I will see how to better make the difference