0
0
Fork 0

refs #5509 fix(FormModel): autoLoad && formInitalData

This commit is contained in:
Alex Moreno 2024-02-22 10:20:44 +01:00
parent 9abac4a8fb
commit 00bed4fd61
2 changed files with 8 additions and 4 deletions

View File

@ -79,9 +79,8 @@ onMounted(async () => {
}); });
// Podemos enviarle al form la estructura de data inicial sin necesidad de fetchearla // Podemos enviarle al form la estructura de data inicial sin necesidad de fetchearla
if ($props.formInitialData || !$props.autoLoad) {
state.set($props.model, $props.formInitialData ?? {}); state.set($props.model, $props.formInitialData ?? {});
} else { if ($props.autoLoad && !$props.formInitialData) {
await fetch(); await fetch();
} }

View File

@ -174,7 +174,12 @@ async function upsert() {
@on-fetch="(data) => (userConfig = data)" @on-fetch="(data) => (userConfig = data)"
auto-load auto-load
/> />
<FormModel v-if="invoiceIn" :url="`InvoiceIns/${route.params.id}`" model="invoiceIn"> <FormModel
v-if="invoiceIn"
:url="`InvoiceIns/${route.params.id}`"
model="invoiceIn"
:auto-load="true"
>
<template #form="{ data }"> <template #form="{ data }">
<div class="row q-gutter-md q-mb-md"> <div class="row q-gutter-md q-mb-md">
<div class="col"> <div class="col">