- Install Shadcn Form components (FormControl, FormDescription, FormItem, FormLabel, FormMessage) - Add vee-validate 4.15.1 for form validation - Add zod 3.25.76 for schema validation - Add @vee-validate/zod 4.15.1 for integration - Update reka-ui to 2.5.0 - Prepare foundation for proper form handling with type-safe validation - Enables proper checkbox array handling and form accessibility 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
23 lines
561 B
Vue
23 lines
561 B
Vue
<script lang="ts" setup>
|
|
import type { HTMLAttributes } from "vue"
|
|
import { ErrorMessage } from "vee-validate"
|
|
import { toValue } from "vue"
|
|
import { cn } from "@/lib/utils"
|
|
import { useFormField } from "./useFormField"
|
|
|
|
const props = defineProps<{
|
|
class?: HTMLAttributes["class"]
|
|
}>()
|
|
|
|
const { name, formMessageId } = useFormField()
|
|
</script>
|
|
|
|
<template>
|
|
<ErrorMessage
|
|
:id="formMessageId"
|
|
data-slot="form-message"
|
|
as="p"
|
|
:name="toValue(name)"
|
|
:class="cn('text-destructive text-sm', props.class)"
|
|
/>
|
|
</template>
|