Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/MetinSeylan/Vue-Easy-Validator
Easy form validation plugin
https://github.com/MetinSeylan/Vue-Easy-Validator
Last synced: 3 months ago
JSON representation
Easy form validation plugin
- Host: GitHub
- URL: https://github.com/MetinSeylan/Vue-Easy-Validator
- Owner: MetinSeylan
- Created: 2016-10-30T12:26:26.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2016-10-30T13:11:03.000Z (about 8 years ago)
- Last Synced: 2024-09-19T19:51:24.217Z (4 months ago)
- Language: JavaScript
- Homepage: http://metinseylan.com
- Size: 43.9 KB
- Stars: 24
- Watchers: 4
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-github-vue - Vue-Easy-Validator - 简单的表单验证 (实用库)
- awesome - Vue-Easy-Validator - 简单的表单验证 (实用库)
- awesome-vue - Vue-Easy-Validator - Easy-Validator?style=social) - 简单的表单验证 (实用库)
- awesome-github-vue - Vue-Easy-Validator - 简单的表单验证 (实用库)
README
# Vue-Easy-Validator
Easy form validator, bridge of vee-validate## Install
``` bash
npm install vue-easy-validator --save
```
``` js
import VueEasyValidator from 'vue-easy-validator'
Vue.use(VueEasyValidator)
```## Usage
### Template
``` html
{{form.$errors.first('email')}}
{{form.$errors.first('password')}}
```
### Script``` js
new Vue({
data(){
return{
form: this.$form({
email: {
rule: 'email|required',
value: 'imamhatipler kapatılsın' // => set default value
},
password: {
rule: 'required|min:3',
value: null
}
})
}
},
mounted(){
console.log(this.form.$fields); // => Form values (dynamic)
console.log(this.form.$rules); // => Form rules (dynamic)
console.log(this.form.$errors); // Form errors (instance of vee-validate errorBag)
console.log(this.$validator); // => vee-validate instance
}
})
```