Skip to content

Commit

Permalink
fix: form prop handleValuesChange no effect
Browse files Browse the repository at this point in the history
  • Loading branch information
mynetfan committed Dec 6, 2024
1 parent d1862fb commit 8ecd99d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/@core/ui-kit/form-ui/src/vben-use-form.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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 },
Expand Down

0 comments on commit 8ecd99d

Please sign in to comment.