Breaking Changes
- All data-* attributes are now prefixed with
vv, looks likedata-vv-rulesto ensure no conflicts happen in the future. validateAllnow 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
setLocalethat 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
setDefaultLocalemethod has been removed.
New Features
- Error Selectors: you can filter the error message you want to display in both
firstandhasmethods by the rule name, for example if you want to display the first error message that is associated with the rulerequiredfor the name field you would use:errors.first('name:required');. - The validation is now also triggered by
blurevent 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
inputevent whenever the value changes, further more they should also either have a property callednameor havedata-vv-nameattribute to denote the field name, it should also havedata-vv-value-pathattribute 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
_confirmationwith 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.