From 8ecd99d3e04d3ecef5e489e1e403853708f0fc0c Mon Sep 17 00:00:00 2001 From: Netfan Date: Fri, 6 Dec 2024 22:14:52 +0800 Subject: [PATCH] fix: `form` prop `handleValuesChange` no effect --- packages/@core/ui-kit/form-ui/src/vben-use-form.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/@core/ui-kit/form-ui/src/vben-use-form.vue b/packages/@core/ui-kit/form-ui/src/vben-use-form.vue index 107bb4bf353..a13953284f3 100644 --- a/packages/@core/ui-kit/form-ui/src/vben-use-form.vue +++ b/packages/@core/ui-kit/form-ui/src/vben-use-form.vue @@ -6,7 +6,7 @@ import type { ExtendedFormApi, VbenFormProps } from './types'; import { useForwardPriorityValues } from '@vben-core/composables'; // import { isFunction } from '@vben-core/shared/utils'; -import { useTemplateRef, watch } from 'vue'; +import { toRaw, useTemplateRef, watch } from 'vue'; import { useDebounceFn } from '@vueuse/core'; @@ -62,6 +62,9 @@ function handleKeyDownEnter(event: KeyboardEvent) { watch( () => form.values, useDebounceFn(() => { + (props.handleValuesChange ?? state.value.handleValuesChange)?.( + toRaw(form.values), + ); state.value.submitOnChange && props.formApi?.submitForm(); }, 300), { deep: true },