From 00bed4fd619652d44bcdd4df8ff0ee4f73e62259 Mon Sep 17 00:00:00 2001 From: alexm Date: Thu, 22 Feb 2024 10:20:44 +0100 Subject: [PATCH] refs #5509 fix(FormModel): autoLoad && formInitalData --- src/components/FormModel.vue | 5 ++--- src/pages/InvoiceIn/Card/InvoiceInBasicData.vue | 7 ++++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/components/FormModel.vue b/src/components/FormModel.vue index c33835438..504a7acd6 100644 --- a/src/components/FormModel.vue +++ b/src/components/FormModel.vue @@ -79,9 +79,8 @@ onMounted(async () => { }); // Podemos enviarle al form la estructura de data inicial sin necesidad de fetchearla - if ($props.formInitialData || !$props.autoLoad) { - state.set($props.model, $props.formInitialData ?? {}); - } else { + state.set($props.model, $props.formInitialData ?? {}); + if ($props.autoLoad && !$props.formInitialData) { await fetch(); } diff --git a/src/pages/InvoiceIn/Card/InvoiceInBasicData.vue b/src/pages/InvoiceIn/Card/InvoiceInBasicData.vue index 2a29a3d0e..306220dd3 100644 --- a/src/pages/InvoiceIn/Card/InvoiceInBasicData.vue +++ b/src/pages/InvoiceIn/Card/InvoiceInBasicData.vue @@ -174,7 +174,12 @@ async function upsert() { @on-fetch="(data) => (userConfig = data)" auto-load /> - +