Build a Twitter Clone With Adonis and Vue

Install VeeValidate

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:

// src/main.js

// add this after Vue import
import VeeValidate from 'vee-validate'

// register vee validate plugin
Vue.use(VeeValidate)

Now we can start using the VeeValidate plugin.