diff --git a/.changeset/eight-adults-kiss.md b/.changeset/eight-adults-kiss.md new file mode 100644 index 000000000..b6b83b56f --- /dev/null +++ b/.changeset/eight-adults-kiss.md @@ -0,0 +1,5 @@ +--- +'vee-validate': patch +--- + +feat: add label support to defineField closes #4530 diff --git a/docs/src/components/examples/CompositionBasic.vue b/docs/src/components/examples/CompositionBasic.vue index d900aba4f..3f3acdce2 100644 --- a/docs/src/components/examples/CompositionBasic.vue +++ b/docs/src/components/examples/CompositionBasic.vue @@ -7,12 +7,12 @@ const schema = yup.object({ password: yup.string().min(6).required(), }); -const { defineInputBinds, errors, handleSubmit } = useForm({ +const { defineField, errors, handleSubmit } = useForm({ validationSchema: schema, }); -const email = defineInputBinds('email'); -const password = defineInputBinds('password'); +const [email, emailAttrs] = defineField('email'); +const [password, passwordAttrs] = defineField('password'); const onSubmit = handleSubmit(values => { alert(JSON.stringify(values, null, 2)); @@ -21,10 +21,10 @@ const onSubmit = handleSubmit(values => {