refs #7136 use paginate when url exists
gitea/salix-front/pipeline/pr-dev Build queued... Details

This commit is contained in:
Javier Segarra 2024-04-05 13:59:23 +02:00
parent 3159c1c049
commit 243d66b592
2 changed files with 40 additions and 44 deletions

View File

@ -60,7 +60,7 @@ const $props = defineProps({
},
limit: {
type: [Number, String],
default: '30',
default: '4',
},
fetchRef: {
type: Object,
@ -165,11 +165,12 @@ async function onScroll(scrollEv) {
const lastIndex = myOptions.value.length - 1;
const optionIndex = ref.getOptionIndex();
if (!$props.fetchRef) return;
if (!$props.url && !$props.fetchRef) return;
if (direction === 'decrease') return;
if (optionIndex > 0 && to === lastIndex && isLoading.value === false) {
isLoading.value = true;
await $props.fetchRef.paginate();
!$props.url && (await $props.fetchRef.paginate());
$props.url && (await dataRef.value.paginate());
}
}
</script>

View File

@ -30,7 +30,6 @@ const suppliersRef = ref();
limit="30"
auto-load
@on-fetch="(data) => (suppliers = data)"
auto-load
/>
<VnFilterPanel :data-key="props.dataKey" :search-button="true">
<template #tags="{ tag, formatFn }">
@ -72,11 +71,7 @@ const suppliersRef = ref();
</QItem>
<QItem>
<QItemSection>
<VnInputDate
:label="t('From')"
v-model="params.from"
is-outlined
/>
<VnInputDate :label="t('From')" v-model="params.from" is-outlined />
</QItemSection>
</QItem>
<QItem>