Breaking Changes
- All data-* attributes are now prefixed with
vv
, looks likedata-vv-rules
to ensure no conflicts happen in the future. validateAll
now always returns a promise regardless if you have passed parameters or not, it also doesn't rely on events anymore to trigger validation. however upon failure it is not rejected yet (next release).- All validators now share a global locale configuration, using the method
setLocale
that is available both statically and on validator instances will change the locale for all validators since it doesn't make sense to have two validators operating on different locales. - static
setDefaultLocale
method has been removed.
New Features
- Error Selectors: you can filter the error message you want to display in both
first
andhas
methods by the rule name, for example if you want to display the first error message that is associated with the rulerequired
for the name field you would use:errors.first('name:required');
. - The validation is now also triggered by
blur
event by default. - You can specify which events to trigger validation using:
data-vv-validate-on="input|blur"
which is the default, you may specify custom events or different ones, events are separated by a pipe. - Custom components can now be validated, but they must emit
input
event whenever the value changes, further more they should also either have a property calledname
or havedata-vv-name
attribute to denote the field name, it should also havedata-vv-value-path
attribute to denote the internal value state so it can be used withvalidateAll
. - Confirmed rule does not require the target field name anymore, instead it prefixes
_confirmation
with the field name unless specified. - New rules:
min_value
: compares against a minimum numeric value.max_value
: compares against a maximum numeric value.credit_card
: validates a credit card number.
- New Locales:
- Korean.
- Georgian.
- Russian.
- Swedish.
- Polish.
Full Changelog is here.