diff --git a/src/runtime/components/Form.vue b/src/runtime/components/Form.vue index c5f4d5dc87..a215c4a33f 100644 --- a/src/runtime/components/Form.vue +++ b/src/runtime/components/Form.vue @@ -2,12 +2,12 @@ import type { DeepReadonly } from 'vue' import type { AppConfig } from '@nuxt/schema' import theme from '#build/ui/form' -import type { FormSchema, FormError, FormInputEvents, FormErrorEvent, FormSubmitEvent, FormEvent, Form, FormErrorWithId, InferInput, InferOutput } from '../types/form' +import type { FormSchema, FormError, FormInputEvents, FormErrorEvent, FormSubmitEvent, FormEvent, Form, FormErrorWithId, InferInput, InferOutput, FormData } from '../types/form' import type { ComponentConfig } from '../types/utils' type FormConfig = ComponentConfig -export interface FormProps { +export interface FormProps { id?: string | number /** Schema to validate the form state. Supports Standard Schema objects, Yup, Joi, and Superstructs. */ schema?: S @@ -35,7 +35,7 @@ export interface FormProps { * If true, schema transformations will be applied to the state on submit. * @defaultValue `true` */ - transform?: boolean + transform?: T /** * If true, this form will attach to its parent Form (if any) and validate at the same time. @@ -50,11 +50,11 @@ export interface FormProps { */ loadingAuto?: boolean class?: any - onSubmit?: ((event: FormSubmitEvent>) => void | Promise) | (() => void | Promise) + onSubmit?: ((event: FormSubmitEvent>) => void | Promise) | (() => void | Promise) } -export interface FormEmits { - (e: 'submit', payload: FormSubmitEvent>): void +export interface FormEmits { + (e: 'submit', payload: FormSubmitEvent>): void (e: 'error', payload: FormErrorEvent): void } @@ -63,7 +63,7 @@ export interface FormSlots { } -