From 0cc0e82aaaba838cbcd6c7ced6d52347af7438d0 Mon Sep 17 00:00:00 2001 From: jorgep Date: Sun, 27 Oct 2024 14:48:44 +0100 Subject: [PATCH] feat: refs #8078 add shortcut multi selection --- src/components/VnTable/VnTable.vue | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/components/VnTable/VnTable.vue b/src/components/VnTable/VnTable.vue index c1680bf13..74a96e0e3 100644 --- a/src/components/VnTable/VnTable.vue +++ b/src/components/VnTable/VnTable.vue @@ -331,6 +331,16 @@ 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; + for (const row of rows) { + if (row.$index > rowIndex) break; + selected.value.push(row); + } + } +}