npm vee-validate 2.0.0-rc.22

latest releases: 4.12.8, 4.12.7, 4.12.6...
6 years ago

🐛 Bugs Fixed

  • Fixed an issue with programatic use of url and ip rules would trigger a console warning #966
  • Fixed an issue with scoped fields' flags being placed the root level instead of nesting them under $scopeName prefix #949

✨ Enhancements

  • The pending flag is now set to true before the validation kicks in, meaning in debounced/delayed validation the pending flag will be true before the delay amount has passed. #985
  • Errors are now being added after validation instead of during, which should reduce flickering behavior when long running validations are pending.
  • Deprecate the title attribute being used as a fallback for the field alias, the title attribute has a wide array of use cases and shouldn't be used by vee-validate. #983
  • Delays can now be configured per event thanks to @sebastianbarfurth for PR #954
Vue.use(VeeValidate, {
  delay: {
    blur: 1000,
    input: 2000,
  },
  events: 'input|blur|focus',
});

// Now blur event will have a 1sec debounce, input event 2sec debounce, and focus will have 0sec since it is not specified.
  • mapFields Now offers additional mapping utilities:
export default {
  // ...
  computed: {
    all: mapFields(), // Maps all fields within the validator instance.
    ...mapFields({
      scopeless: '*', // map fields without a scope
      myScope: 'scope.*', // map all fields within a scope
      myField: 'field',  // map a single field
      scopedField: 'scope.field' // map a scoped field
    })
  }
  // ...
};

This additions should make it easier to manage form states, without having to build computed properties manually, the flags are merged based on their meanings:

  • touched: true if one field is touched.
  • untouched: true if all fields are untouched.
  • dirty: true if one field is dirty.
  • pristine: true if all fields are pristine.
  • invalid: true if one field is invalid.
  • valid: true if all fields are valid.
  • pending: true if one field is pending validation.
  • validated: true if all fields have been validated at least once

Don't miss a new vee-validate release

NewReleases is sending notifications on new releases.