chore(FormField): rename inputId to id

This commit is contained in:
Benjamin Canac
2024-04-28 11:46:24 +02:00
parent 65e916d09a
commit 16071846a8
9 changed files with 33 additions and 33 deletions

View File

@@ -58,11 +58,11 @@ const error = computed(() => {
: formErrors?.value?.find(error => error.name === props.name)?.message
})
const inputId = ref(useId())
const id = ref(useId())
provide<FormFieldInjectedOptions<FormFieldProps>>('form-field', {
error,
inputId,
id,
name: computed(() => props.name),
size: computed(() => props.size),
eagerValidation: computed(() => props.eagerValidation),
@@ -74,7 +74,7 @@ provide<FormFieldInjectedOptions<FormFieldProps>>('form-field', {
<div :class="ui.root({ class: props.class })">
<div :class="ui.wrapper()">
<div v-if="label || $slots.label" :class="ui.labelWrapper()">
<Label :for="inputId" :class="ui.label()">
<Label :for="id" :class="ui.label()">
<slot name="label" :label="label">
{{ label }}
</slot>