#6480 improve Card #271

Merged
jorgep merged 36 commits from 6480-improveCard into dev 2024-04-24 06:57:38 +00:00
2 changed files with 5 additions and 7 deletions
Showing only changes of commit e38b53ca25 - Show all commits

View File

@ -1,6 +1,5 @@
<script setup>
import { onBeforeMount, watch, computed, ref } from 'vue';

Si solo se usa en el template se puede usar $slots

Si solo se usa en el template se puede usar $slots
import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n';
import SkeletonDescriptor from 'components/ui/SkeletonDescriptor.vue';
import { useArrayData } from 'composables/useArrayData';
@ -40,7 +39,6 @@ const $props = defineProps({
const state = useState();
const { t } = useI18n();
const route = useRoute();
const { viewSummary } = useSummaryDialog();
const arrayData = useArrayData($props.dataKey || $props.module, {
url: $props.url,
@ -56,14 +54,12 @@ defineExpose({
});
onBeforeMount(async () => {
await getData();
watch(
() => route.params.id,
async () => await getData()
);
watch($props, async () => await getData());
});
async function getData() {
store.url = $props.url;
store.filter = $props.filter ?? {};
Review

En la sección workerDescriptor fallaba porque se le estaba pasando en el filtro route.params.id y este no se actualizaba por lo que se hacía la llamada con el id anterior

En la sección workerDescriptor fallaba porque se le estaba pasando en el filtro route.params.id y este no se actualizaba por lo que se hacía la llamada con el id anterior
isLoading.value = true;
try {
const { data } = await arrayData.fetch({ append: false, updateRouter: false });

View File

@ -31,7 +31,9 @@ const entityId = computed(() => {
});
const worker = ref();
const filter = { where: { id: route.params.id}};
const filter = computed(() => {
Review

Es necesario para que se actualice al cambiar de ruta.

Es necesario para que se actualice al cambiar de ruta.
return { where: { id: entityId.value } };
});
const sip = ref(null);