[Vuejs]-How can I avoid table from being empty even I change the show entries to 10/25/50/100 and click the pagination?

0👍

Your startIndex & endIndex are set to the same value when you go back to the minimum value from a larger value. So the condition in <tr ..... v-if="index >= startIndex && index < endIndex"> fails and no records are displayed. Simply reset the pagination to the first page so the indexes are re-calculated.

showEntries: function (value) {
   this.endIndex = value;
   this.pagination(1);
}

Leave a comment