https://github.com/chantouch/vue-vlidator
To integrate with client and server-side validation logical with VueJS.
https://github.com/chantouch/vue-vlidator
client-side laravel proxy ruby server-side validator vue-components vuejs
Last synced: about 1 year ago
JSON representation
To integrate with client and server-side validation logical with VueJS.
- Host: GitHub
- URL: https://github.com/chantouch/vue-vlidator
- Owner: Chantouch
- License: mit
- Created: 2020-06-10T06:05:38.000Z (about 6 years ago)
- Default Branch: develop
- Last Pushed: 2022-12-13T03:18:10.000Z (over 3 years ago)
- Last Synced: 2025-04-20T19:16:31.899Z (about 1 year ago)
- Topics: client-side, laravel, proxy, ruby, server-side, validator, vue-components, vuejs
- Language: JavaScript
- Size: 6.6 MB
- Stars: 6
- Watchers: 2
- Forks: 1
- Open Issues: 18
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Vue Vlidator
[](https://npmjs.com/package/vue-vlidator)
[](LICENSE.md)
[](https://npmjs.com/package/vue-vlidator)
[](https://npmjs.com/package/vue-vlidator)
## Installation
### Using npm
```npm
npm install vue-vlidator
```
### Using yarn
```yarn
yarn add vue-vlidator
```
## Use with NuxtJS
Put it on top of `nuxt-i18n`
``nuxt.config.js``
```js
export default {
modules: [
'vue-vlidator/nuxt',
'nuxt-i18n',
],
vlidator: {}
}
```
### Vue plugins
```js
import Vue from 'vue';
import Validator from 'vue-vlidator';
const options = { locale: 'km', customAttributes: {}, customMessages: {} }
Vue.use(Validator, options);
```
#### Available options
1. locale {string}
2. customMessages {Object}
3. customAttributes {Object}
#### Example in Vue component
```vue
Submit
export default {
name: "HomePage",
data () {
return {
form: {
name: 'John',
email: 'johndoe@gmail.com',
age: 18
}
}
},
vlidator: {
rules: {
form: {
name: 'required|min:4',
email: 'required|email',
age: 'required|numeric|min:18|max:50'
}
}
},
methods: {
onSubmit () {
if (!this.validate()) return
alert(JSON.stringify(this.form))
}
},
}
```
---
### License
Copyright © 2020 Chantouch Sek
Released under the MIT license
### Credits
vue-vlidator re-write by Chantouch Sek
E-Mail: [chantouchsek.cs83@gmail.com](mailto:chantouchsek.cs93@gmail.com)
Twitter [@DevidCs83](https://twitter.com/DevidCs83)
Website: [chantouch.me](https://chantouch.me)