Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xrado/vue-validator
form validator for vue 0.11
https://github.com/xrado/vue-validator
Last synced: 4 months ago
JSON representation
form validator for vue 0.11
- Host: GitHub
- URL: https://github.com/xrado/vue-validator
- Owner: xrado
- Created: 2014-10-28T13:17:02.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-10-09T21:12:42.000Z (over 9 years ago)
- Last Synced: 2024-08-01T00:39:27.386Z (6 months ago)
- Language: JavaScript
- Homepage: http://xrado.github.io/vue-validator/
- Size: 305 KB
- Stars: 48
- Watchers: 2
- Forks: 10
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-vue-cn - Vue validator ★34
README
vue-validator
=============form validator for vue 0.11
__usage:__
var Vue = require('vue')
var validator = require('vue-validator')
Vue.use(validator)in template
means.. name is required, must be at least 3 character length and only alphabetic characters. If all this rules are satisfied input will get valid class otherwise invalid. Validator status is held in vm.validator. See demo.js for more examples of usage.
For custom elements you can specify model name in additional attribute model.
__v-valid options:__
* required
* numeric
* integer
* digits
* alpha
* alphaNum
* url
* minLength: min string length
* maxLength: max string length
* length: string length
* min: number value
* max: number value
* pattern: regex
* group: group nameYou can add additional filters to Vue.util.validators
__validator data:__
* valid - input is valid
* modified - input is modified (current value != start value)
* invalid - modified and invalid__methods added to VM:__
* $valid([group]) - return if true if form is valid (group is optional)
* $modified([group]) - return if true if form is modified (group is optional)DEMO
----[http://xrado.github.io/vue-validator/](http://xrado.github.io/vue-validator/)
TODO
----* may still need some tweaking
* tests## License
[MIT](http://opensource.org/licenses/MIT)
Copyright (c) 2014 Radovan Lozej