Rethinking validations for Vue.js

Introducing Vuelidate

Vuelidate is a lightweight model-based validation for Vue.js 2.0. There are of course already validator libraries dedicated for Vue.js like vue-validator or vee-validate. If you have worked with these before you would have noticed that both those libraries work quite similarly, in a way they require you to write the rules inside the template.

However, if you work on a more data-oriented application you’ll notice that you’re validating much more than just your inputs. Then you have to combine the above approach with custom validation methods or computed values.

This comes to iIntroducing Vuelidate. The biggest difference is that the validations are completely decoupled from the template. It provides custom validators, support for function composition, validates different data sources: Vuex getters, computed values, etc. and has high test coverage.

Check out the documentation, created by Damian Dulisz & Paweł Grabarz.

Read the post by Monterail, here.