Recall that we said all form validation will be handled on the client side. When it comes to client-side validation with Vue, I tend to always go with the VeeValidate plugin because it is powerful and has a very expressive API. So, we'll be using it for our client-side validation.

Let's install the plugin:

npm install vee-validate --save

Once installed, before we can start to use it in our Vue app, we need to tell Vue to make use of the plugin. To do that, open src/main.js and add the code below to it:

Table of Contents

    // src/main.js
    // add this after Vue import
    import VeeValidate from 'vee-validate'
    // register vee validate plugin

    Now we can start using the VeeValidate plugin.

    Chimezie Enyinnaya

    20 posts

    Software Developer [PHP Laravel JavaScript NodeJS AdonisJS VueJS] | movie lover | run