warmFix_hasMoreData #308

Merged
jorgep merged 10 commits from warmFix_hasMoreData into dev 2024-04-23 07:12:55 +00:00
1 changed files with 3 additions and 6 deletions
Showing only changes of commit 1f391dc49b - Show all commits

View File

@ -9,9 +9,7 @@ const arrayDataStore = useArrayDataStore();
export function useArrayData(key, userOptions) {
if (!key) throw new Error('ArrayData: A key is required to use this composable');
if (!arrayDataStore.get(key)) {
arrayDataStore.set(key);
}
if (!arrayDataStore.get(key)) arrayDataStore.set(key);
const store = arrayDataStore.get(key);
const hasMoreData = computed(() => arrayDataStore.hasMoreData);
@ -22,6 +20,7 @@ export function useArrayData(key, userOptions) {
onMounted(() => {
setOptions();
store.skip = 0;

Al cambiar de página se seguía manteniendo el filtro aplicado. Con esto se setea a cero y cuando lo vuelves a montar se cargan los registros desde el principio.

Al cambiar de página se seguía manteniendo el filtro aplicado. Con esto se setea a cero y cuando lo vuelves a montar se cargan los registros desde el principio.
const query = route.query;
if (query.params) {
@ -29,9 +28,7 @@ export function useArrayData(key, userOptions) {
}
});
if (key && userOptions) {
setOptions();
}
if (key && userOptions) setOptions();
function setOptions() {
const allowedOptions = [