What is Vuelidate?

Vuelidate is an open source, lightweight library that helps us perform model validation with a variety of validation contexts. Validation can be functionally composed and it also works well with other libraries such as Moment, Vuex, and more. As we've installed it in our project with npm install vuelidate, we now need to register it as a plugin within main.js:

import Vue from 'vue';
import Vuelidate from 'vuelidate';
import App from './App.vue';

Vue.use(Vuelidate);

new Vue({
el: '#app',
validations: {},
render: h => h(App),
});

Adding the empty validations object to our main Vue instance bootstraps Vuelidate's $v throughout the project. This then allows us to use the $v object to gain information about the current state of our form within our Vue instance across all components.