#8725 - submit_form_onClick #1564

Merged
jsegarra merged 25 commits from 8725_submit_form_onClick into dev 2025-04-08 12:58:52 +00:00
2 changed files with 5 additions and 5 deletions
Showing only changes of commit 32dac089f8 - Show all commits

View File

@ -144,8 +144,8 @@ const defaultButtons = computed(() => ({
}));
const submitForm = async () => {
const valid = await myForm.value.validate();
if (valid) {
const isFormValid = await myForm.value.validate();
if (isFormValid) {
try {
Outdated
Review

sin try catch deberia fallar igual

sin try catch deberia fallar igual

cierto, la costumbre

cierto, la costumbre
await save();
} catch (error) {
@ -333,7 +333,6 @@ async function onKeyup(evt) {
}
defineExpose({
myForm,
save,
isLoading,
hasChanges,
@ -347,7 +346,7 @@ defineExpose({
<QForm
ref="myForm"
v-if="formData"
@submit.prevent="save"
@submit.prevent
Review

Aqui se esta llamando

Aqui se esta llamando
Review

validations devuelve una función

validations devuelve una función
@keyup.prevent="onKeyup"
@reset="reset"
class="q-pa-md"

View File

@ -43,7 +43,6 @@ const onDataSaved = async (formData, requestResponse) => {
const onClick = async (saveAndContinue) => {
isSaveAndContinue.value = saveAndContinue;
formModelRef.value.myForm.submit();
};
defineExpose({
@ -88,6 +87,7 @@ defineExpose({
:flat="showSaveAndContinueBtn"
:label="t('globals.save')"
:title="t('globals.save')"
@click="onClick(false)"
type="submit"
color="primary"
class="q-ml-sm"
@ -101,6 +101,7 @@ defineExpose({
:label="t('globals.isSaveAndContinue')"
:title="t('globals.isSaveAndContinue')"
color="primary"
type="submit"
class="q-ml-sm"
:disabled="isLoading"
:loading="isLoading"