npm vee-validate 2.0.0-beta.15

latest releases: 4.12.6, 4.12.5, 4.12.4...
7 years ago

Breaking Changes

  • All data-* attributes are now prefixed with vv, looks like data-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 and has methods by the rule name, for example if you want to display the first error message that is associated with the rule required 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 called name or have data-vv-name attribute to denote the field name, it should also have data-vv-value-path attribute to denote the internal value state so it can be used with validateAll.
  • 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.

Don't miss a new vee-validate release

NewReleases is sending notifications on new releases.