diff --git a/docs/components/content/examples/FormExampleJoi.vue b/docs/components/content/examples/FormExampleJoi.vue index ebcbf84986..486f7586cc 100644 --- a/docs/components/content/examples/FormExampleJoi.vue +++ b/docs/components/content/examples/FormExampleJoi.vue @@ -3,8 +3,8 @@ import { ref } from 'vue' import Joi from 'joi' const schema = Joi.object({ - email: Joi.string().required(), - password: Joi.string() + emailJoi: Joi.string().required(), + passwordJoi: Joi.string() .min(8) .required() }) @@ -29,11 +29,11 @@ async function submit () { :state="state" @submit.prevent="submit" > - + - + diff --git a/docs/components/content/examples/FormExampleYup.vue b/docs/components/content/examples/FormExampleYup.vue index b7ba81e5f5..37de1bdc09 100644 --- a/docs/components/content/examples/FormExampleYup.vue +++ b/docs/components/content/examples/FormExampleYup.vue @@ -4,8 +4,8 @@ import { object, string, InferType } from 'yup' import type { Form } from '@nuxthq/ui/dist/runtime/types' const schema = object({ - email: string().email('Invalid email').required('Required'), - password: string() + emailYup: string().email('Invalid email').required('Required'), + passwordYup: string() .min(8, 'Must be at least 8 characters') .required('Required') }) @@ -32,11 +32,11 @@ async function submit () { :state="state" @submit.prevent="submit" > - + - + diff --git a/docs/components/content/examples/FormExampleZod.vue b/docs/components/content/examples/FormExampleZod.vue index 5a6c5968f5..7cb2040d94 100644 --- a/docs/components/content/examples/FormExampleZod.vue +++ b/docs/components/content/examples/FormExampleZod.vue @@ -4,8 +4,8 @@ import { z } from 'zod' import type { Form } from '@nuxthq/ui/dist/runtime/types' const schema = z.object({ - email: z.string().email('Invalid email'), - password: z.string().min(8, 'Must be at least 8 characters') + emailZod: z.string().email('Invalid email'), + passwordZod: z.string().min(8, 'Must be at least 8 characters') }) type Schema = z.output @@ -30,11 +30,11 @@ async function submit () { :state="state" @submit.prevent="submit" > - + - + diff --git a/docs/content/3.forms/10.form.md b/docs/content/3.forms/10.form.md index 6a180296db..10a7375d43 100644 --- a/docs/content/3.forms/10.form.md +++ b/docs/content/3.forms/10.form.md @@ -301,11 +301,7 @@ defineExpose({ diff --git a/src/runtime/components/forms/Form.ts b/src/runtime/components/forms/Form.ts index 9a5c8b38b2..68dccd283f 100644 --- a/src/runtime/components/forms/Form.ts +++ b/src/runtime/components/forms/Form.ts @@ -68,6 +68,8 @@ export default defineComponent({ `Form validation failed: ${JSON.stringify(errors.value, null, 2)}` ) } + + return props.state } expose({