From c42c811444a767f0c5ac884383429b5b41e8a341 Mon Sep 17 00:00:00 2001 From: jorgep Date: Thu, 17 Oct 2024 17:39:49 +0200 Subject: [PATCH 1/2] fix: refs #7353 load on scroll end --- src/components/VnTable/VnTable.vue | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/components/VnTable/VnTable.vue b/src/components/VnTable/VnTable.vue index 5a30f4d53..05bc6edeb 100644 --- a/src/components/VnTable/VnTable.vue +++ b/src/components/VnTable/VnTable.vue @@ -134,6 +134,7 @@ const splittedColumns = ref({ columns: [] }); const columnsVisibilitySkipped = ref(); const createForm = ref(); const tableFilterRef = ref([]); +const tableRef = ref(); const tableModes = [ { @@ -321,6 +322,12 @@ function handleOnDataSaved(_) { if (_.onDataSaved) _.onDataSaved({ CrudModelRef: CrudModelRef.value }); else $props.create.onDataSaved(_); } + +function handleScroll() { + const tMiddle = tableRef.value.$el.querySelector('.q-table__middle'); + const isAtBottom = tMiddle.scrollHeight - tMiddle.scrollTop === tMiddle.clientHeight; + if (isAtBottom) CrudModelRef.value.vnPaginateRef.paginate(); +}