fix(Form): conflict on submit event type

This commit is contained in:
Romain Hamel
2025-04-08 22:32:47 +02:00
parent 4c667f75f4
commit 4548c527d0

View File

@@ -43,8 +43,7 @@ export interface FormProps<T extends object> {
onSubmit?: ((event: FormSubmitEvent<T>) => void | Promise<void>) | (() => void | Promise<void>)
}
export interface FormEmits<T extends object> {
(e: 'submit', payload: FormSubmitEvent<T>): void
export interface FormEmits {
(e: 'error', payload: FormErrorEvent): void
}
@@ -68,7 +67,7 @@ const props = withDefaults(defineProps<FormProps<T>>(), {
transform: true
})
const emits = defineEmits<FormEmits<T>>()
const emits = defineEmits()
defineSlots<FormSlots>()
const formId = props.id ?? useId() as string