Skip to content

Commit

Permalink
feat(form): pass form states to slot bind
Browse files Browse the repository at this point in the history
  • Loading branch information
m0ksem committed May 25, 2024
1 parent 8f65106 commit 2827911
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion packages/ui/src/components/va-form/VaForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,24 @@
@submit="(e: SubmitEvent) => $attrs.action === undefined && e.preventDefault()"
v-bind="$attrs"
>
<slot v-bind="{ isValid, validate }" />
<slot v-bind="{
isValid,
isDirty,
isTouched,
isLoading,
errorMessages,
errorMessagesNamed,
formData,
fields,
fieldsNamed,
fieldNames,
validate,
validateAsync,
reset,
resetValidation,
focus,
focusInvalidField,
}" />
</component>
</template>

Expand Down

0 comments on commit 2827911

Please sign in to comment.