mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-27 10:20:42 +01:00
docs(form): fix nested form example schema (#3135)
This commit is contained in:
@@ -4,7 +4,7 @@ import type { FormSubmitEvent } from '@nuxt/ui'
|
|||||||
|
|
||||||
const schema = z.object({
|
const schema = z.object({
|
||||||
name: z.string().min(2),
|
name: z.string().min(2),
|
||||||
news: z.boolean()
|
news: z.boolean().default(false)
|
||||||
})
|
})
|
||||||
|
|
||||||
type Schema = z.output<typeof schema>
|
type Schema = z.output<typeof schema>
|
||||||
@@ -36,7 +36,7 @@ async function onSubmit(event: FormSubmitEvent<any>) {
|
|||||||
</UFormField>
|
</UFormField>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<UCheckbox v-model="state.news" name="news" label="Register to our newsletter" />
|
<UCheckbox v-model="state.news" name="news" label="Register to our newsletter" @update:model-value="state.email = undefined" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<UForm v-if="state.news" :state="state" :schema="nestedSchema">
|
<UForm v-if="state.news" :state="state" :schema="nestedSchema">
|
||||||
|
|||||||
Reference in New Issue
Block a user