feat(Form): nested form validation (#23)

Co-authored-by: Benjamin Canac <canacb1@gmail.com>
This commit is contained in:
Romain Hamel
2024-03-21 18:39:59 +01:00
committed by GitHub
parent f086f2662e
commit 167127861f
9 changed files with 604 additions and 144 deletions

View File

@@ -37,7 +37,7 @@ export interface FormFieldSlots {
<script lang="ts" setup>
import { computed, ref, inject, provide, type Ref } from 'vue'
import type { FormError, InjectedFormFieldOptions } from '../types/form'
import type { FormError, FormFieldInjectedOptions } from '../types/form'
import { useId } from '#imports'
const props = defineProps<FormFieldProps>()
@@ -59,7 +59,7 @@ const error = computed(() => {
const inputId = ref(useId())
provide<InjectedFormFieldOptions<FormFieldProps>>('form-field', {
provide<FormFieldInjectedOptions<FormFieldProps>>('form-field', {
error,
inputId,
name: computed(() => props.name),