refs #7136 perf: remove onPaginate emit

This commit is contained in:
Javier Segarra 2024-03-26 06:16:53 +01:00
parent b6f68321af
commit 9ed8a0b51d
2 changed files with 7 additions and 2 deletions

View File

@ -62,6 +62,10 @@ const $props = defineProps({
type: Number,
default: 30,
},
fetchRef: {
type: Object,
default: null,
},
});
const { t } = useI18n();
@ -165,7 +169,8 @@ async function onScroll(scrollEv) {
if (direction === 'decrease') return;
if (optionIndex > 0 && to === lastIndex && isLoading.value === false) {
isLoading.value = true;
emit('onPaginate');
// emit('onPaginate');
await $props.fetchRef.paginate();
}
}
</script>

View File

@ -87,7 +87,7 @@ const businessTypesRef = ref();
option-label="description"
option-value="code"
v-model="data.businessTypeFk"
@on-paginate="(data) => businessTypesRef.paginate()"
:fetch-ref="businessTypesRef"
/>
</div>
<div class="col">