👕 TypeScript
This release is aimed at resolving #4421
useForm#defineComponentBinds
is now more strict and provides accurate typings for bothmodelValue
andupdate:modeValue
properties. Previously they were not exposed.
Try the following example.
const { defineComponentBinds } = useForm({
validationSchema: toTypedSchema(yup.object({
date: yup.date().required(),
number: yup.number().required(),
string: yup.string().required(),
valueModel: yup.string().required(),
})),
});
const date = defineComponentBinds('date');
const number = defineComponentBinds('number');
const string = defineComponentBinds('string');
const valueModel = defineComponentBinds('valueModel');