Select all table rows in all pages
- Add @toggle-select-all="selectAll" in table
<v-data-table v-model="selectedTasks" :headers="headers"
:items="tasks" item-key="id" show-select
:toggle-select-all="selectAll">
</v-data-table>
selectAll(event) {
if (event.value === true) {
this.selectedTasks = [...this.tasks];
} else {
this.selectedTasks = [];
}
}
Working example - https://jsfiddle.net/ktrajasekar/8nqu64f9
Top comments (0)