@vee-validate/rules
@vee-validate/rules
Common Laravel-Like rules module for vee-validate
What's this
VeeValidate v4 breaks up the parts that made it a popular solution for form validation into it isolated parts. The core vee-validate package no longer includes the rules that came by default in previous releases, the built-in rules were rebranded as global validators,
This is where this package comes in, It includes the most common validators you will use in most of your applications, vee-validate allows you to express global rules just like Laravel's validation syntax.
Installation
yarn add @vee-validate/rules
# or with npm
npm install @vee-validate/rules
Usage
Use the defineRule function from vee-validate core library to add rules exported by this library:
import { defineRule } from 'vee-validate';
import { required, email, min } from '@vee-validate/rules';
defineRule('required', required);
defineRule('email', email);
defineRule('min', min);
Or you can globally define all the available rules in the @vee-validate/rules package:
import { defineRule } from 'vee-validate';
import * as rules from '@vee-validate/rules';
Object.keys(rules).forEach(rule => {
defineRule(rule, rules[rule]);
});
Available Rules
- alpha
- alpha_dash
- alpha_num
- alpha_spaces
- between
- confirmed
- digits
- dimensions
- excluded
- ext
- image
- one_of
- integer
- is
- is_not
- length
- max
- max_value
- mimes
- min
- min_value
- numeric
- regex
- required
- required_if
- size
For more information about each rules, check the documentation for global validators
Credits
- Inspired by Laravel's validation syntax
Related Packages
Version History
| Version | Released | License |
|---|---|---|
| 4.15.1 | MIT | |
| 4.15.0 | MIT | |
| 4.14.7 | MIT | |
| 4.14.6 | MIT | |
| 4.14.5 | MIT | |
| 4.14.4 | MIT | |
| 4.14.3 | MIT | |
| 4.14.2 | MIT | |
| 4.14.1 | MIT | |
| 4.14.0 | MIT | |
| 4.13.2 | MIT | |
| 4.13.1 | MIT | |
| 4.13.0 | MIT | |
| 4.12.8 | MIT | |
| 4.12.7 | MIT | |
| 4.12.6 | MIT | |
| 4.12.5 | MIT | |
| 4.12.4 | MIT | |
| 4.12.3 | MIT | |
| 4.12.2 | MIT | |
| 4.12.1 | MIT | |
| 4.12.0 | MIT | |
| 4.11.8 | MIT | |
| 4.11.7 | MIT | |
| 4.11.6 | MIT | |
| 4.11.5 | MIT | |
| 4.11.4 | MIT | |
| 4.11.3 | MIT | |
| 4.11.2 | MIT | |
| 4.11.1 | MIT |
Showing the latest 30 of 117. See every release on npm
Pre-releases (17)
| Version | Released | License |
|---|---|---|
| 5.0.0-beta.1 | MIT | |
| 5.0.0-beta.0 | MIT | |
| 4.12.0-alpha.1 | MIT | |
| 4.12.0-alpha.0 | MIT | |
| 4.5.0-alpha.6 | MIT | |
| 4.5.0-alpha.5 | MIT | |
| 4.5.0-alpha.4 | MIT | |
| 4.5.0-alpha.3 | MIT | |
| 4.5.0-alpha.2 | MIT | |
| 4.5.0-alpha.1 | MIT | |
| 4.5.0-alpha.0 | MIT | |
| 4.4.0-alpha.2 | MIT | |
| 4.4.0-alpha.1 | MIT | |
| 4.4.0-alpha.0 | MIT | |
| 4.0.0-beta.0 | MIT | |
| 4.0.0-alpha.2 | MIT | |
| 4.0.0-alpha.1 | MIT |