Skip to content

Commit fe369f9

Browse files
committed
docs: correct examples
1 parent 628ac7d commit fe369f9

File tree

4 files changed

+15
-13
lines changed

4 files changed

+15
-13
lines changed

docs/src/components/Repl.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ store.setImportMap({
4141
toposort: 'https://esm-repo.netlify.app/topsort.esm.js',
4242
yup: 'https://unpkg.com/[email protected]/index.esm.js',
4343
zod: 'https://unpkg.com/[email protected]/lib/index.mjs',
44-
valibot: 'https://unpkg.com/browse/valibot@0.7.0/dist/index.js',
44+
valibot: 'https://unpkg.com/valibot@0.21.0/dist/index.js',
4545
'@vue/devtools-api': 'https://unpkg.com/@vue/[email protected]/lib/esm/index.js',
4646
vue: `https://unpkg.com/vue@${version}/dist/vue.esm-browser.prod.js`,
4747
},

docs/src/components/examples/CompositionComponentBindsBasic03.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const { values, errors, defineField } = useForm({
1010
});
1111
1212
const [email, emailProps] = defineField('email', {
13-
validateOnValueUpdate: false,
13+
validateOnModelUpdate: false,
1414
});
1515
</script>
1616

docs/src/components/examples/CompositionHandlingForms08.vue

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import { useForm } from 'vee-validate';
33
import * as yup from 'yup';
44
5-
const { resetForm, defineField, meta } = useForm({
5+
const { resetForm, defineField, meta, errors } = useForm({
66
validationSchema: yup.object({
77
name: yup.string().required(),
88
email: yup.string().email().required(),
@@ -16,7 +16,7 @@ const [password, passwordAttrs] = defineField('password');
1616
</script>
1717

1818
<template>
19-
<form @submit="">
19+
<form>
2020
<input v-model="name" v-bind="nameAttrs" />
2121
{{ errors.name }}
2222

@@ -26,13 +26,15 @@ const [password, passwordAttrs] = defineField('password');
2626
<input type="password" v-model="password" v-bind="passwordAttrs" />
2727
{{ errors.password }}
2828

29-
<button type="button" @click="resetForm()">Reset</button>
30-
<button
31-
type="button"
32-
@click="resetForm({ values: { email: '[email protected]' }, errors: { password: 'Password taken 😜' } })"
33-
>
34-
Reset to specific state
35-
</button>
29+
<div>
30+
<button type="button" @click="resetForm()">Reset</button>
31+
<button
32+
type="button"
33+
@click="resetForm({ values: { email: '[email protected]' }, errors: { password: 'Password taken :-)' } })"
34+
>
35+
Reset to specific state
36+
</button>
37+
</div>
3638

3739
<pre>{{ meta }}</pre>
3840
</form>

docs/src/components/examples/CompositionValibotBasic.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<script setup>
22
import { useForm } from 'vee-validate';
33
import { toTypedSchema } from '@vee-validate/valibot';
4-
import { email, string, minLength, object } from 'valibot';
4+
import { email as emailValidator, string, minLength, object } from 'valibot';
55
66
const { errors, defineField } = useForm({
77
validationSchema: toTypedSchema(
88
object({
9-
email: string([minLength(1, 'Email is required'), email()]),
9+
email: string([minLength(1, 'Email is required'), emailValidator()]),
1010
password: string([minLength(6, 'password too short')]),
1111
}),
1212
),

0 commit comments

Comments
 (0)