Skip to content

Commit 512956a

Browse files
author
Mauricio Santelices
committed
added a fix for when data changes and reset the currentPage to 1
1 parent 64ae64a commit 512956a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/DataTable.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,12 @@
467467
if (this.searching && this.serverSearch && this.serverSearchFunc)
468468
this.serverSearchFunc(newSearchInput);
469469
},
470+
471+
rows(newRows, oldRows) {
472+
// If the number of rows change, reset the currentPage to 1
473+
if(newRows !== oldRows)
474+
this.currentPage = 1;
475+
},
470476
},
471477
472478
computed: {

0 commit comments

Comments
 (0)