docs(Form): fixed invalid state attributes in examples (#479)

This commit is contained in:
Romain Hamel
2023-08-01 18:34:52 +02:00
committed by Benjamin Canac
parent 75d26e0c2b
commit e2146a5a58
3 changed files with 12 additions and 12 deletions

View File

@@ -10,8 +10,8 @@ const schema = Joi.object({
})
const state = ref({
email: undefined,
password: undefined
emailJoi: undefined,
passwordJoi: undefined
})
const form = ref()
@@ -30,11 +30,11 @@ async function submit () {
@submit.prevent="submit"
>
<UFormGroup label="Email" name="emailJoi">
<UInput v-model="state.email" />
<UInput v-model="state.emailJoi" />
</UFormGroup>
<UFormGroup label="Password" name="passwordJoi">
<UInput v-model="state.password" type="password" />
<UInput v-model="state.passwordJoi" type="password" />
</UFormGroup>
<UButton type="submit">

View File

@@ -13,8 +13,8 @@ const schema = object({
type Schema = InferType<typeof schema>
const state = ref({
email: undefined,
password: undefined
emailYup: undefined,
passwordYup: undefined
})
const form = ref<Form<Schema>>()
@@ -33,11 +33,11 @@ async function submit () {
@submit.prevent="submit"
>
<UFormGroup label="Email" name="emailYup">
<UInput v-model="state.email" />
<UInput v-model="state.emailYup" />
</UFormGroup>
<UFormGroup label="Password" name="passwordYup">
<UInput v-model="state.password" type="password" />
<UInput v-model="state.passwordYup" type="password" />
</UFormGroup>
<UButton type="submit">

View File

@@ -11,8 +11,8 @@ const schema = z.object({
type Schema = z.output<typeof schema>
const state = ref({
email: undefined,
password: undefined
emailZod: undefined,
passwordZod: undefined
})
const form = ref<Form<Schema>>()
@@ -31,11 +31,11 @@ async function submit () {
@submit.prevent="submit"
>
<UFormGroup label="Email" name="emailZod">
<UInput v-model="state.email" />
<UInput v-model="state.emailZod" />
</UFormGroup>
<UFormGroup label="Password" name="passwordZod">
<UInput v-model="state.password" type="password" />
<UInput v-model="state.passwordZod" type="password" />
</UFormGroup>
<UButton type="submit">