Skip to content

Commit 3dc77bd

Browse files
committed
moved pagination info component stuff to main component (slot issue)
1 parent ecf13cd commit 3dc77bd

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

src/components/VueBootstrap4Table.vue

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,21 @@
6969
</ul>
7070
</nav>
7171
</div>
72-
<!-- <Pagination :page.sync="page" :per_page="per_page" :total="rowCount" :pagiantion_limit="pagiantion_limit"></Pagination> -->
7372
</div>
7473
<div class="col-md-6">
75-
<PaginationInfo :current-page-rows-length="vbt_data.rows.length" :filtered-rows-length="rowCount" :original-rows-length="data.rows.length"></PaginationInfo>
74+
<div class="text-right justify-content-center">
75+
<slot name="pagination-info" :currentPageRowsLength="currentPageRowsLength" :filteredRowsLength="filteredRowsLength" :originalRowsLength="originalRowsLength">
76+
<template v-if="currentPageRowsLength != 0">
77+
From 1 to {{currentPageRowsLength}} of {{filteredRowsLength}} entries
78+
</template>
79+
<template v-else>
80+
No results found
81+
</template>
82+
<template>
83+
({{originalRowsLength}} total records)
84+
</template>
85+
</slot>
86+
</div>
7687
</div>
7788
</div>
7889
</div>
@@ -432,6 +443,17 @@ export default {
432443
return has_unique_id;
433444
},
434445
446+
currentPageRowsLength() {
447+
return this.vbt_data.rows.length;
448+
},
449+
450+
filteredRowsLength() {
451+
return this.rowCount;
452+
},
453+
454+
originalRowsLength() {
455+
return this.data.rows.length;
456+
}
435457
},
436458
watch: {
437459
"query.filters": {

0 commit comments

Comments
 (0)