@vee-validate/rules

Form Validation for Vue.js
- Static
- Latest Patch
- Latest Minor
- Latest Major
- 4.15.1
- 4.15.0
- 4.14.7
- 4.14.6
- 4.14.5
- 4.14.4
- 4.14.3
- 4.14.2
- 4.14.1
- 4.14.0
- 4.13.2
- 4.13.1
- 4.13.0
- 4.12.8
- 4.12.7
- 4.12.6
- 4.12.5
- 4.12.4
- 4.12.3
- 4.12.2
- 4.12.1
- 4.12.0
- 4.11.8
- 4.11.7
- 4.11.6
- 4.11.5
- 4.11.4
- 4.11.3
- 4.11.2
- 4.11.1
- 4.11.0
- 4.10.9
- 4.10.8
- 4.10.7
- 4.10.6
- 4.10.5
- 4.10.4
- 4.10.3
- 4.10.2
- 4.10.1
- 4.10.0
- 4.9.6
- 4.9.5
- 4.9.4
- 4.9.3
- 4.9.2
- 4.9.1
- 4.9.0
- 4.8.6
- 4.8.5
- 4.8.4
- 4.8.3
- 4.8.2
- 4.8.1
- 4.8.0
- 4.7.4
- 4.7.3
- 4.7.2
- 4.7.1
- 4.7.0
- 4.6.10
- 4.6.9
- 4.6.8
- 4.6.7
- 4.6.6
- 4.6.5
- 4.6.4
- 4.6.3
- 4.6.2
- 4.6.1
- 4.6.0
- 4.5.11
- 4.5.10
- 4.5.9
- 4.5.8
- 4.5.7
- 4.5.6
- 4.5.5
- 4.5.4
- 4.5.3
- 4.5.2
- 4.5.1
- 4.5.0
- 4.4.11
- 4.4.10
- 4.4.9
- 4.4.8
- 4.4.7
- 4.4.6
- 4.4.5
- 4.4.4
- 4.4.3
- 4.4.2
- 4.4.1
- 4.4.0
- 4.3.6
- 4.3.5
- 4.3.4
- 4.3.3
- 4.3.2
- 4.3.1
- 4.3.0
- 4.2.4
- 4.2.3
- 4.2.2
- 4.2.1
- 4.2.0
- 4.1.20
- 4.1.19
- 4.1.17
- 4.0.6
- 4.0.5
- 4.0.4
- 4.0.3
- 4.0.2
- 4.0.1
- 4.0.0
- 4.12.0-alpha.1
- 4.12.0-alpha.0
- 4.5.0-alpha.6
- 4.5.0-alpha.5
- 4.5.0-alpha.4
- 4.5.0-alpha.3
- 4.5.0-alpha.2
- 4.5.0-alpha.1
- 4.5.0-alpha.0
- 4.4.0-alpha.2
- 4.4.0-alpha.1
- 4.4.0-alpha.0
- 4.0.0-beta.0
- 4.0.0-alpha.2
- 4.0.0-alpha.1
@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