diff --git a/src/components/FormModel.vue b/src/components/FormModel.vue index 04b4b201..70c9369f 100644 --- a/src/components/FormModel.vue +++ b/src/components/FormModel.vue @@ -113,6 +113,8 @@ onUnmounted(() => { state.unset($props.model); }); +const formRef = ref(); + const isLoading = ref(false); // Si elegimos observar los cambios del form significa que inicialmente las actions estaran deshabilitadas const isResetting = ref(false); @@ -152,6 +154,8 @@ async function fetch() { } async function save() { + const isValid = await formRef.value.validate(); + if (!isValid) return; if ($props.observeFormChanges && !hasChanges.value) { notify('globals.noChanges', 'negative'); return; @@ -214,6 +218,7 @@ watch(formUrl, async () => {