Skip to content

Commit 5e2d1ae

Browse files
author
Yousef Sultan
committed
Fix 'All' option for rows count not working properly
Signed-off-by: Yousef Sultan <[email protected]>
1 parent f4a7b78 commit 5e2d1ae

File tree

4 files changed

+14
-12
lines changed

4 files changed

+14
-12
lines changed

docs/css/app.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/js/app.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-materialize-datatable",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"description": "Datatable for VueJS with Materialize",
55
"author": "Yousef Sultan <[email protected]>",
66
"private": false,

src/DataTable.vue

+11-9
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,16 @@
7979
</td>
8080
<slot name="tbody-tr" :row="row" />
8181
</tr>
82-
<tr
83-
v-for="n in currentPerPage"
84-
v-if="rows.length === 0 && loadingAnimation === true"
85-
>
86-
<td :colspan="columns.length">
87-
<tb-skeleton :height="15" theme="opacity" bg-color="#dcdbdc" shape="radius" />
88-
</td>
89-
</tr>
82+
83+
<template v-if="rows.length === 0 && loadingAnimation === true">
84+
<tr v-for="n in (currentPerPage === -1 ? 10 : currentPerPage)"
85+
:key="n"
86+
>
87+
<td :colspan="columns.length">
88+
<tb-skeleton :height="15" theme="opacity" bg-color="#dcdbdc" shape="radius" />
89+
</td>
90+
</tr>
91+
</template>
9092
</tbody>
9193
</table>
9294

@@ -536,7 +538,7 @@
536538
paginated() {
537539
let paginatedRows = this.processedRows;
538540
539-
if (this.paginate)
541+
if (this.paginate && this.currentPerPage !== -1)
540542
paginatedRows = paginatedRows.slice(
541543
(this.currentPage - 1) * this.currentPerPage,
542544
this.currentPerPage === -1 ? paginatedRows.length + 1 : this.currentPage * this.currentPerPage

0 commit comments

Comments
 (0)