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

View File

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