Skip to content

Commit

Permalink
Fixed pagination when filtered table
Browse files Browse the repository at this point in the history
  • Loading branch information
mosinve committed Apr 6, 2017
1 parent 88c69ee commit fae39fd
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/components/table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@
itemsProvider: {
type: Function,
default: null
},
value: {
type: Number,
default: 0
}
},
Expand Down Expand Up @@ -127,12 +131,11 @@
return this.sortDesc ? r : r * -1;
});
}
this.$emit('input', items.length);
// Apply pagination
if (this.perPage) {
items = items.slice((this.currentPage - 1) * this.perPage, this.currentPage * this.perPage);
}
return items;
}
},
Expand Down

0 comments on commit fae39fd

Please sign in to comment.