mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-14 20:19:34 +01:00
feat(FormGroup): add eager validation (#992)
This commit is contained in:
@@ -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>
|
||||
Reference in New Issue
Block a user