6825-fix_vnSelectCache_and_autoload #557
|
@ -1,5 +1,5 @@
|
|||
<script setup>
|
||||
import { ref, onMounted, computed, watch } from 'vue';
|
||||
import { ref, onBeforeMount, onMounted, computed, watch } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import { useQuasar } from 'quasar';
|
||||
|
@ -96,6 +96,7 @@ const DEFAULT_MODE = 'card';
|
|||
const TABLE_MODE = 'table';
|
||||
const mode = ref(DEFAULT_MODE);
|
||||
const selected = ref([]);
|
||||
const hasParams = ref(false);
|
||||
alexm marked this conversation as resolved
|
||||
const routeQuery = JSON.parse(route?.query[$props.searchUrl] ?? '{}');
|
||||
const params = ref({ ...routeQuery, ...routeQuery.filter?.where });
|
||||
const orders = ref(parseOrder(routeQuery.filter?.order));
|
||||
|
@ -117,11 +118,14 @@ const tableModes = [
|
|||
disable: $props.disableOption?.card,
|
||||
},
|
||||
];
|
||||
onBeforeMount(() => {
|
||||
setUserParams(route.query[$props.searchUrl]);
|
||||
hasParams.value = Object.keys(params.value).length !== 0;
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
mode.value = quasar.platform.is.mobile ? DEFAULT_MODE : $props.defaultMode;
|
||||
stateStore.rightDrawer = true;
|
||||
setUserParams(route.query[$props.searchUrl]);
|
||||
columnsVisibilitySkiped.value = [
|
||||
...splittedColumns.value.columns
|
||||
.filter((c) => c.visible == false)
|
||||
|
@ -295,6 +299,7 @@ defineExpose({
|
|||
:disable-infinite-scroll="isTableMode"
|
||||
@save-changes="reload"
|
||||
:has-sub-toolbar="$attrs['hasSubToolbar'] ?? isEditable"
|
||||
:auto-load="hasParams || $attrs['auto-load']"
|
||||
>
|
||||
<template
|
||||
v-for="(_, slotName) in $slots"
|
||||
|
|
Loading…
Reference in New Issue
entiendo que no has puesto $attrs['auto-load'] para evitar traerte useAttrs