-
Notifications
You must be signed in to change notification settings - Fork 573
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(FormGroup): add eager validation (#992)
- Loading branch information
1 parent
9df9b9a
commit d39e2de
Showing
6 changed files
with
38 additions
and
2 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
docs/components/content/examples/FormGroupEagerValidationExample.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
d39e2de
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
ui – ./
ui-git-dev-nuxt-js.vercel.app
ui.nuxt.com
ui-nuxt-js.vercel.app