npm vee-validate 4.12.0

latest releases: 4.13.2, 4.13.1, 4.13.0...
10 months ago

💣 Breaking Changes

Deprecated reactive initial values #4402 (bbecc97)

Initial values can no longer be reactive since they did not serve any purpose for being so. The recommended API for setting async initial values is by explicitly calling resetForm.

🆕 defineField API #4497

This is a new function available on useForm and is meant to replace useFieldModel, defineInputBinds and defineComponentBinds by building upon and improving those APIs.

<script setup>
import { useForm } from 'vee-validate';

const { defineField, errors } = useForm({
  validationSchema: schema,
  validateOnMount: true,
});

const [email, emalProps] = defineField('email', { validateOnModelUpdate: true });
const [password, pwProps] = defineField('password', { validateOnModelUpdate: true });
</script>

<template>
  <input v-model="email" v-bind="emailProps" />
  <span>{{ errors.email }}</span>

  <input  v-model="password" v-bind="pwProps" />
  <span>{{ errors.password }}</span>
</div>
</template>

The docs have been updated to reflect using this new API instead of the deprecated ones. The old ones will continue to work till they get removed in next minor releases.

🆕 DX improvements

  • feat: add label support to defineField #4530 (f9a9584)
  • feat(DX): allow getters for field arrays paths (95b701f)

🐛 Bug Fixes

Don't miss a new vee-validate release

NewReleases is sending notifications on new releases.