Skip to content
Source
Sign inSign up
TanStack/form
Open History to see the last commit

form.ts

16 lines485 Bytes

1import { createFormHook, getFormHookHelpers } from '@tanstack/vue-form'
2import SubscribeButton from '../components/SubscribeButton.vue'
3import TextField from '../components/TextField.vue'
4​
5const { fieldComponent } = getFormHookHelpers()
6​
7const AppTextField = fieldComponent.strict(TextField, 'field')
8​
9export const { appFormOptions, useAppForm, useFormContext } = createFormHook({
10 fieldComponents: {
11 TextField: AppTextField,
12 },
13 formComponents: {
14 SubscribeButton,
15 },
16})