Skip to content

Commit

Permalink
paging optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
xaksis committed Feb 17, 2021
1 parent 323207d commit ba8e877
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
2 changes: 0 additions & 2 deletions src/components/Table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
:ofText="ofText"
:pageText="pageText"
:allText="allText"
:paginated="paginated"
></vgt-pagination>
</slot>
<vgt-global-search
Expand Down Expand Up @@ -331,7 +330,6 @@
:ofText="ofText"
:pageText="pageText"
:allText="allText"
:paginated="paginated"
></vgt-pagination>
</slot>
</div>
Expand Down
4 changes: 1 addition & 3 deletions src/components/VgtPagination.vue
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ export default {
ofText: { default: 'of' },
pageText: { default: 'page' },
allText: { default: 'All' },
paginated: {},
},
data() {
Expand Down Expand Up @@ -128,8 +127,7 @@ export default {
// Current displayed items
paginatedInfo() {
let first = ((this.currentPage - 1) * this.currentPerPage) + 1;
let last = Math.min(this.total, this.currentPage * this.currentPerPage);
// last = last - this.paginated.length;
const last = Math.min(this.total, this.currentPage * this.currentPerPage);
if (last === 0) {
first = 0;
Expand Down

0 comments on commit ba8e877

Please sign in to comment.