simple-vue-validator

lightweight yet flexible validation lib for vue.js
96,321 289
Install
npm install simple-vue-validator
Latest Version:0.16.0
Vue:2
License:MIT
Last Updated:Jan 11, 2023
Links: GitHub  ·  npm
Maintainer: semisleep

Simple Vue Validator

Simple Vue validator is a lightweight yet flexible plugin for Vue.js 2.0 that allows you to validate input fields, and display errors. It watches changes of your model data, validates them and informs you with the validation result.

It supports the following features:

  • Fully customized validation rules.
  • Cross field validation.
  • Async/ajax validation (with supports of loading indicator, result caching, debounced user input).
  • Validating custom component.
  • Dynamic form / multiple validation instances.

Documentation

Please checkout the full documentation for more detail.

Installation

Package is installable via npm.

npm install --save simple-vue-validator

You can also install it via bower.

bower install --save simple-vue-validator

NOTE: for bower package, please use /dist/plugin.js.

Configuration

import Vue from 'vue';
import SimpleVueValidation from 'simple-vue-validator';
Vue.use(SimpleVueValidation);

Basic Usage

Define the validators object in your vue / component instance:

validators: {
      email: function (value) {
        return Validator.value(value).required().email();
      }
    }

In the template HTML use the validation object injected by the library to display validation status / results.

<div class="message">{{ validation.firstError('email') }}</div>

Please checkout the full documentation for more detail.

license MIT

Related Packages

simple-vue3-validator

lightweight yet flexible validation lib for vue.js - fork of simple-vue-validato...

9,899 8
vue-dog-form

The simplest vue 3 form validation plugin.

65,599 8
vue-form-2

Vue.js 2 form component

16,113 55
@vuetils/form

Tiny form validation library for Vue

10,354 3

Version History

Version Released License
0.16.0 MIT
0.15.1 MIT
0.15.0 MIT
0.14.2 MIT
0.14.1 MIT