fix: `form` prop `handleValuesChange` no effect (#5060)
parent
d42daf9ce0
commit
03f166f8a4
|
@ -6,7 +6,7 @@ import type { ExtendedFormApi, VbenFormProps } from './types';
|
||||||
import { useForwardPriorityValues } from '@vben-core/composables';
|
import { useForwardPriorityValues } from '@vben-core/composables';
|
||||||
// import { isFunction } from '@vben-core/shared/utils';
|
// import { isFunction } from '@vben-core/shared/utils';
|
||||||
|
|
||||||
import { useTemplateRef, watch } from 'vue';
|
import { toRaw, useTemplateRef, watch } from 'vue';
|
||||||
|
|
||||||
import { useDebounceFn } from '@vueuse/core';
|
import { useDebounceFn } from '@vueuse/core';
|
||||||
|
|
||||||
|
@ -62,6 +62,9 @@ function handleKeyDownEnter(event: KeyboardEvent) {
|
||||||
watch(
|
watch(
|
||||||
() => form.values,
|
() => form.values,
|
||||||
useDebounceFn(() => {
|
useDebounceFn(() => {
|
||||||
|
(props.handleValuesChange ?? state.value.handleValuesChange)?.(
|
||||||
|
toRaw(form.values),
|
||||||
|
);
|
||||||
state.value.submitOnChange && props.formApi?.submitForm();
|
state.value.submitOnChange && props.formApi?.submitForm();
|
||||||
}, 300),
|
}, 300),
|
||||||
{ deep: true },
|
{ deep: true },
|
||||||
|
|
Loading…
Reference in New Issue