https://github.com/semisleep/simple-vue-validator
A simple yet flexible validator library for vue.js
https://github.com/semisleep/simple-vue-validator
Last synced: 4 months ago
JSON representation
A simple yet flexible validator library for vue.js
- Host: GitHub
- URL: https://github.com/semisleep/simple-vue-validator
- Owner: semisleep
- License: mit
- Created: 2016-12-09T13:55:55.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2023-01-11T22:28:35.000Z (almost 3 years ago)
- Last Synced: 2025-06-19T23:09:18.050Z (5 months ago)
- Language: Vue
- Homepage:
- Size: 4.97 MB
- Stars: 292
- Watchers: 9
- Forks: 28
- Open Issues: 35
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-vue - simple-vue-validator - A simple yet flexible validator library for vue.js. (Components & Libraries / UI Utilities)
- awesome-vue-refactor - **simple-vue-validator ★17**
- awesome-vue-zh - 简单Vue验证器 - 一个简单而灵活的vue.js验证器库. (UI实用程序 / 形成)
- awesome-vue - simple-vue-validator - A simple yet flexible validator library for vue.js. (UI Utilities / Form)
README
# NOTE FOR VUE3
Please use this fork if you are using vue3: [simple-vue3-validator](https://github.com/rak-phillip/simple-vue3-validator)
# 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](http://simple-vue-validator.magictek.cn) 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:
```javascript
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.
```html
```
Please checkout the [full documentation](http://simple-vue-validator.magictek.cn) for more detail.
## license MIT