This commit is contained in:
parent
3159c1c049
commit
243d66b592
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue