From dd7bd6ab6a82ce056186c5c906b5818070e7dc5b Mon Sep 17 00:00:00 2001 From: Abdelrahman Awad Date: Sun, 19 Nov 2023 18:25:44 +0200 Subject: [PATCH] docs: update the defineField trigger info --- .../components/examples/CompositionComponentBindsBasic05.vue | 4 +--- docs/src/components/examples/CompositionInputBindsBasic03.vue | 2 +- docs/src/pages/guide/composition-api/getting-started.mdx | 4 ++-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/docs/src/components/examples/CompositionComponentBindsBasic05.vue b/docs/src/components/examples/CompositionComponentBindsBasic05.vue index fdb2a6f8a..5bbef5d79 100644 --- a/docs/src/components/examples/CompositionComponentBindsBasic05.vue +++ b/docs/src/components/examples/CompositionComponentBindsBasic05.vue @@ -1,19 +1,17 @@ diff --git a/docs/src/components/examples/CompositionInputBindsBasic03.vue b/docs/src/components/examples/CompositionInputBindsBasic03.vue index e1c67c25a..2683113e5 100644 --- a/docs/src/components/examples/CompositionInputBindsBasic03.vue +++ b/docs/src/components/examples/CompositionInputBindsBasic03.vue @@ -9,7 +9,7 @@ const { values, errors, defineField } = useForm({ }); const [email, emailAttrs] = defineField('email', { - validateOnInput: true, + validateOnModelUpdate: false, }); diff --git a/docs/src/pages/guide/composition-api/getting-started.mdx b/docs/src/pages/guide/composition-api/getting-started.mdx index 15dc3c822..9388e9623 100644 --- a/docs/src/pages/guide/composition-api/getting-started.mdx +++ b/docs/src/pages/guide/composition-api/getting-started.mdx @@ -113,9 +113,9 @@ Here is a full running example: -Notice as you blur the input, the validation is then triggered and the errors are populated. By default `defineField` optimizes for lazy validation, meaning the validation will be triggered on `change` and on `blur` events. +Notice as you type into the input, the validation is then triggered and the errors are populated. By default `defineField` optimizes for aggressive validation, meaning the validation will be triggered whenever the model changes. -You can change that behavior. For example, you can make it "aggressive" by passing a configuration to `defineField` to validate `input` events. +You can change that behavior. For example, you can make it "lazy" by passing a configuration to `defineField` to disable validation on model updates with `validateOnModelUpdate` config.