Skip to content

Commit

Permalink
feat: expose errorBag to <Form /> slot props
Browse files Browse the repository at this point in the history
  • Loading branch information
logaretm committed Mar 12, 2023
1 parent 9c80df6 commit 371744e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/vee-validate/src/Form.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ type FormSlotProps = UnwrapRef<
FormContext,
| 'meta'
| 'errors'
| 'errorBag'
| 'values'
| 'isSubmitting'
| 'submitCount'
Expand Down Expand Up @@ -88,6 +89,7 @@ const FormImpl = defineComponent({

const {
errors,
errorBag,
values,
meta,
isSubmitting,
Expand Down Expand Up @@ -146,6 +148,7 @@ const FormImpl = defineComponent({
function getMeta<TValues extends GenericFormValues = GenericFormValues>() {
return deepCopy(meta.value) as FormMeta<TValues>;
}

function getErrors<TValues extends GenericFormValues = GenericFormValues>() {
return deepCopy(errors.value) as FormErrors<TValues>;
}
Expand All @@ -154,7 +157,8 @@ const FormImpl = defineComponent({
return {
meta: meta.value,
errors: errors.value,
values: values,
errorBag: errorBag.value,
values,
isSubmitting: isSubmitting.value,
submitCount: submitCount.value,
controlledValues: controlledValues.value,
Expand Down

0 comments on commit 371744e

Please sign in to comment.