0
0
Fork 0

fix: skip

This commit is contained in:
Jorge Penadés 2024-04-22 13:17:05 +02:00
parent 80844e7869
commit 1f391dc49b
1 changed files with 3 additions and 6 deletions

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;
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 = [