From 015ceacb11f94c6ae0829e59b8dfdef6c325b67d Mon Sep 17 00:00:00 2001 From: Romain Hamel Date: Wed, 19 Feb 2025 16:22:36 +0100 Subject: [PATCH] feat(Form): add prop to disable state transformation (#3356) --- src/runtime/components/Form.vue | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/runtime/components/Form.vue b/src/runtime/components/Form.vue index 4812dd37..17fbb309 100644 --- a/src/runtime/components/Form.vue +++ b/src/runtime/components/Form.vue @@ -20,6 +20,7 @@ export interface FormProps { disabled?: boolean validateOnInputDelay?: number class?: any + transform?: boolean onSubmit?: ((event: FormSubmitEvent) => void | Promise) | (() => void | Promise) } @@ -46,8 +47,10 @@ const props = withDefaults(defineProps>(), { validateOn() { return ['input', 'blur', 'change'] as FormInputEvents[] }, - validateOnInputDelay: 300 + validateOnInputDelay: 300, + transform: true }) + const emits = defineEmits>() defineSlots() @@ -195,7 +198,7 @@ async function onSubmitWrapper(payload: Event) { const event = payload as FormSubmitEvent try { - event.data = await _validate({ nested: true, transform: true }) + event.data = await _validate({ nested: true, transform: props.transform }) await props.onSubmit?.(event) } catch (error) { if (!(error instanceof FormValidationException)) {