diff --git a/client/src/components/NiceTable.vue b/client/src/components/NiceTable.vue index d7b8baa..f936233 100644 --- a/client/src/components/NiceTable.vue +++ b/client/src/components/NiceTable.vue @@ -84,6 +84,22 @@ function atPath(value: any, path: string): any { } return value; } + +let draggedRow = $ref(-1); +let draggedOverRow = $ref(-1); +function dragDropRow() { + if (data) { + const row = data[draggedRow]; + data.splice(draggedRow, 1); + data.splice(draggedOverRow, 0, row); + data = data; + } + // Reset drag data + draggedRow = 0; + draggedOverRow = 0; + // Kill selection + selection = []; +}