chore: uniformize defineModel placement and emits

This commit is contained in:
Benjamin Canac
2024-04-27 22:16:41 +02:00
parent def5f7c10b
commit ce28e662d6
7 changed files with 21 additions and 22 deletions

View File

@@ -43,7 +43,7 @@ const props = withDefaults(defineProps<FormProps<T>>(), {
},
validateOnInputDelay: 300
})
const emit = defineEmits<FormEmits<T>>()
const emits = defineEmits<FormEmits<T>>()
defineSlots<FormSlots>()
const formId = props.id ?? useId()
@@ -165,7 +165,7 @@ async function onSubmit(payload: Event) {
...event,
data: props.state
}
emit('submit', submitEvent)
emits('submit', submitEvent)
} catch (error) {
if (!(error instanceof FormValidationException)) {
throw error
@@ -177,7 +177,7 @@ async function onSubmit(payload: Event) {
childrens: error.childrens
}
emit('error', errorEvent)
emits('error', errorEvent)
}
}