feat(FormGroup): add eager validation (#992)

This commit is contained in:
Conner Blanton
2023-11-21 16:24:15 -06:00
committed by GitHub
parent 9df9b9a2df
commit d39e2de935
6 changed files with 38 additions and 2 deletions

View File

@@ -0,0 +1,19 @@
<template>
<UForm :schema="schema" :state="state" class="space-y-4">
<UFormGroup label="Username" name="username" eager-validation>
<UInput v-model="state.username" placeholder="Choose Username" />
</UFormGroup>
</UForm>
</template>
<script setup>
import { z } from 'zod'
const schema = z.object({
username: z.string().min(10, 'Must be at least 10 characters')
})
const state = reactive({
username: undefined
})
</script>