feat(Form): add attach prop to opt-out of nested form attachement (#3939)

This commit is contained in:
Romain Hamel
2025-04-20 17:29:36 +02:00
committed by GitHub
parent c31bffad1b
commit 1a0d7a3103
3 changed files with 18 additions and 3 deletions

View File

@@ -39,7 +39,7 @@ async function onSubmit(event: FormSubmitEvent<Schema>) {
<UCheckbox v-model="state.news" name="news" label="Register to our newsletter" @update:model-value="state.email = undefined" />
</div>
<UForm v-if="state.news" :state="state" :schema="nestedSchema">
<UForm v-if="state.news" :state="state" :schema="nestedSchema" attach>
<UFormField label="Email" name="email">
<UInput v-model="state.email" placeholder="john@lennon.com" />
</UFormField>