0
0
Fork 0

Fix Shelving creation

This commit is contained in:
Kevin Martinez 2024-02-06 10:54:06 -03:00
parent 7e45486abd
commit 011e15233e
2 changed files with 13 additions and 4 deletions

View File

@ -1,6 +1,6 @@
<script setup>
import axios from 'axios';
import { onMounted, onUnmounted, computed, ref, watch } from 'vue';
import { onMounted, onUnmounted, computed, ref, watch, nextTick } from 'vue';
import { useI18n } from 'vue-i18n';
import { useQuasar } from 'quasar';
import { useState } from 'src/composables/useState';
@ -67,7 +67,13 @@ defineExpose({
save,
});
const componentIsRendered = ref(false);
onMounted(async () => {
nextTick(() => {
componentIsRendered.value = true;
});
// Podemos enviarle al form la estructura de data inicial sin necesidad de fetchearla
if ($props.formInitialData && !$props.autoLoad) {
state.set($props.model, $props.formInitialData);
@ -202,7 +208,10 @@ watch(formUrl, async () => {
</QCard>
</QForm>
</div>
<Teleport to="#st-actions" v-if="stateStore?.isSubToolbarShown()">
<Teleport
to="#st-actions"
v-if="stateStore?.isSubToolbarShown() && componentIsRendered"
>
<div v-if="$props.defaultActions">
<QBtnGroup push class="q-gutter-x-sm">
<slot name="moreActions" />

View File

@ -60,9 +60,9 @@ const shelvingFilter = {
],
};
const onSave = () => {
const onSave = (shelving, newShelving) => {
if (isNew) {
router.push({ name: 'ShelvingList' });
router.push({ name: 'ShelvingBasicData', params: { id: newShelving?.id } });
}
};
</script>