From 9ed8a0b51d59f1c7e8bd588b4ba757ef5943e0aa Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Tue, 26 Mar 2024 06:16:53 +0100 Subject: [PATCH] refs #7136 perf: remove onPaginate emit --- src/components/common/VnSelectFilter.vue | 7 ++++++- src/pages/Customer/CustomerCreate.vue | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/components/common/VnSelectFilter.vue b/src/components/common/VnSelectFilter.vue index 831921a28..580b79be2 100644 --- a/src/components/common/VnSelectFilter.vue +++ b/src/components/common/VnSelectFilter.vue @@ -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(); } } diff --git a/src/pages/Customer/CustomerCreate.vue b/src/pages/Customer/CustomerCreate.vue index 6afa29380..491a049bd 100644 --- a/src/pages/Customer/CustomerCreate.vue +++ b/src/pages/Customer/CustomerCreate.vue @@ -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" />