diff --git a/src/components/VnTable/VnTable.vue b/src/components/VnTable/VnTable.vue index c1680bf13..dc8671369 100644 --- a/src/components/VnTable/VnTable.vue +++ b/src/components/VnTable/VnTable.vue @@ -331,6 +331,20 @@ function handleScroll() { const isAtBottom = Math.abs(scrollHeight - scrollTop - clientHeight) <= 40; if (isAtBottom) CrudModelRef.value.vnPaginateRef.paginate(); } + +function handleSelection({ evt, added, rows: selectedRows }, rows) { + if (evt?.shiftKey && added) { + const rowIndex = selectedRows[0].$index; + const selectedIndexes = new Set(selected.value.map((row) => row.$index)); + for (const row of rows) { + if (row.$index == rowIndex) break; + if (!selectedIndexes.has(row.$index)) { + selected.value.push(row); + selectedIndexes.add(row.$index); + } + } + } +}