From fbe273c6f2c5d30a1996777561eda2268d8a02e0 Mon Sep 17 00:00:00 2001 From: Abdelrahman Awad Date: Mon, 8 Aug 2022 01:50:04 +0200 Subject: [PATCH] fix: make sure to deep watch created models by useFieldModel --- packages/vee-validate/src/useForm.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/packages/vee-validate/src/useForm.ts b/packages/vee-validate/src/useForm.ts index 3c82740c5..cb7ac6f9b 100644 --- a/packages/vee-validate/src/useForm.ts +++ b/packages/vee-validate/src/useForm.ts @@ -291,11 +291,17 @@ export function useForm = Record(path: MaybeRef) { const { value } = _useFieldValue(path as string); - watch(value, () => { - if (!fieldExists(unref(path as string))) { - validate({ mode: 'validated-only' }); + watch( + value, + () => { + if (!fieldExists(unref(path as string))) { + validate({ mode: 'validated-only' }); + } + }, + { + deep: true, } - }); + ); return value; }