diff --git a/src/components/ui/VnPaginate.vue b/src/components/ui/VnPaginate.vue index d1b2f5ccb..fc81c82b1 100644 --- a/src/components/ui/VnPaginate.vue +++ b/src/components/ui/VnPaginate.vue @@ -61,7 +61,6 @@ const props = defineProps({ }); const emit = defineEmits(['onFetch', 'onPaginate']); -defineExpose({ fetch }); const isLoading = ref(false); const pagination = ref({ sortBy: props.order, @@ -91,6 +90,10 @@ watch( } ); +const addFilter = async (filter, params) => { + await arrayData.addFilter({ filter, params }); +}; + async function fetch() { await arrayData.fetch({ append: false }); if (!arrayData.hasMoreData.value) { @@ -140,6 +143,8 @@ async function onLoad(index, done) { if (store.userParamsChanged) isDone = !arrayData.hasMoreData.value; done(isDone); } + +defineExpose({ fetch, addFilter });