/ Validation

Simple Vue.js input validation plugin

Simple Vue.js input validation plugin

vee-validate

vee-validate is a plugin for Vue.js that allows you to validate input fields, and display errors.

You don't have to do anything fancy in your app, most of the work goes into the html, You only need to specify for each input what kind of validators should be used when the value changes. The errors will be automatically generated. The plugin offers many validations out of the box.

What is vee-validate?

This is a plugin for Vue.js that allows you to validate input fields, and display errors, in an easy and powerful way.
You don't have to do anything fancy in your app, most of the work goes into the html. You only need to specify for each input what kind of validators should be used when the value changes. You will then get informed of the errors for each field.
Although most of the validations occur automatically, you can use the validator however you see fit. The validator object has no dependencies and is a standalone object.

Currently there are over 20 validation rules available in the plugin. This plugin is inspired by PHP Framework Laravel's validation syntax.

Installation

You can install this plugin via npm or via a CDN.
npm

npm install vee-validate --save

CDN

jsdelivr cdn
unpkg

  <script src="path/to/vue.js"></script>
  <script src="path/to/vee-validate.js"></script>
  <script>
    Vue.use(VeeValidate); // good to go. 
  </script>

or you may import it using ES6:

import Vue from 'vue';
import VeeValidate from 'vee-validate';

Vue.use(VeeValidate);

Live Demo

http://vee-validate.logaretm.com/

GitHub