github logaretm/vee-validate v4.5.0

latest releases: v4.12.6, v4.12.5, v4.12.4...
2 years ago

🆕 New Features

Field Arrays

A long-requested feature is a proper way to handle field arrays. With this release you get two ways you can manage your array fields:

  • useFieldArray a composition API version. Read more in docs
  • <FieldArray /> a component API version. Read more in docs.

Both have the same API, and they make managing those fields much easier.

Invalid Submission Handler

Another common request is the ability to handle invalid submissions, for example, you may want to scroll to the first invalid element.

This is now possible with both <Form /> component and useForm composition function. Check the links for their documentation:

Devtools Plugin

vee-validate now ships with its VueDevtools plugin, this will be an invaluable tool to help you debug your forms and their validation state.

This is the initial release for the plugin, so please report any bugs and suggest any improvements you can think of. 🙏

Check the guide page.

💨 Performance Enhancements

A partial re-write of vee-validate v4 fixed a long-standing performance issue that was reported here #3399

💀 Breaking Changes

handleInput is removed from useField after being deprecated since 4.3, you can use handleChange instead of handleInput as follows:

const { handleChange } = useField('email', {
  validateOnValueUpdate: false
});

handleChange('value'); // updates the value and validates
handleChange('value', false); // updates the value without validation

// replace deprecated handleInput with custom one
const handleInput = (val) => handleChange(val, false);

Note that handleInput prop still exists in <Field /> scope slot. This is only for useField.

Note: This release was a 2-month work in progress, so there aren't any bug fixes as 4.4.x was already being worked on in parallel to this release, so both 4.4.x and 4.5.0 contain the same bug fixes which won't be mentioned here in the release notes. Check the previous releases for more information.

Don't miss a new vee-validate release

NewReleases is sending notifications on new releases.