salix-front/patch/7017.patch

31 lines
972 B
Diff

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 () => {
<template>
<div class="column items-center full-width">
<QForm
+ ref="formRef"
v-if="formData"
@submit="save"
@reset="reset"