This commit is contained in:
parent
1f83197440
commit
32dac089f8
|
@ -144,8 +144,8 @@ const defaultButtons = computed(() => ({
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const submitForm = async () => {
|
const submitForm = async () => {
|
||||||
const valid = await myForm.value.validate();
|
const isFormValid = await myForm.value.validate();
|
||||||
if (valid) {
|
if (isFormValid) {
|
||||||
try {
|
try {
|
||||||
await save();
|
await save();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
@ -333,7 +333,6 @@ async function onKeyup(evt) {
|
||||||
}
|
}
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
myForm,
|
|
||||||
save,
|
save,
|
||||||
isLoading,
|
isLoading,
|
||||||
hasChanges,
|
hasChanges,
|
||||||
|
@ -347,7 +346,7 @@ defineExpose({
|
||||||
<QForm
|
<QForm
|
||||||
ref="myForm"
|
ref="myForm"
|
||||||
v-if="formData"
|
v-if="formData"
|
||||||
@submit.prevent="save"
|
@submit.prevent
|
||||||
@keyup.prevent="onKeyup"
|
@keyup.prevent="onKeyup"
|
||||||
@reset="reset"
|
@reset="reset"
|
||||||
class="q-pa-md"
|
class="q-pa-md"
|
||||||
|
|
|
@ -43,7 +43,6 @@ const onDataSaved = async (formData, requestResponse) => {
|
||||||
|
|
||||||
const onClick = async (saveAndContinue) => {
|
const onClick = async (saveAndContinue) => {
|
||||||
isSaveAndContinue.value = saveAndContinue;
|
isSaveAndContinue.value = saveAndContinue;
|
||||||
formModelRef.value.myForm.submit();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
|
@ -88,6 +87,7 @@ defineExpose({
|
||||||
:flat="showSaveAndContinueBtn"
|
:flat="showSaveAndContinueBtn"
|
||||||
:label="t('globals.save')"
|
:label="t('globals.save')"
|
||||||
:title="t('globals.save')"
|
:title="t('globals.save')"
|
||||||
|
@click="onClick(false)"
|
||||||
type="submit"
|
type="submit"
|
||||||
color="primary"
|
color="primary"
|
||||||
class="q-ml-sm"
|
class="q-ml-sm"
|
||||||
|
@ -101,6 +101,7 @@ defineExpose({
|
||||||
:label="t('globals.isSaveAndContinue')"
|
:label="t('globals.isSaveAndContinue')"
|
||||||
:title="t('globals.isSaveAndContinue')"
|
:title="t('globals.isSaveAndContinue')"
|
||||||
color="primary"
|
color="primary"
|
||||||
|
type="submit"
|
||||||
class="q-ml-sm"
|
class="q-ml-sm"
|
||||||
:disabled="isLoading"
|
:disabled="isLoading"
|
||||||
:loading="isLoading"
|
:loading="isLoading"
|
||||||
|
|
Loading…
Reference in New Issue