11<template >
2- <div v-if =" !hidePagination && !hideSummary " class =" flex items-center justify-end mr-2 mb-2 text-xs font-small text-body" >
2+ <div v-if =" !hidePagination && totalRows != 0 " class =" flex items-center justify-end mr-2 mb-2 text-xs font-small text-body" >
33 <span >Displaying {{ fromRow + 1 }} to {{ toRow }} of {{ totalRows }} items</span >
44 </div >
55
6767 </table >
6868
6969 <TVPagination
70- v-if =" totalRows > perPage && !hidePagination"
70+ v-if =" localTotalRows > perPage && !hidePagination"
7171 v-model:currentPage =" localCurrentPage"
72- :total-rows =" totalRows "
72+ :total-rows =" localTotalRows "
7373 :per-page =" perPage"
7474 />
7575</template >
@@ -103,14 +103,13 @@ const props = defineProps({
103103 type: Number ,
104104 default: 15
105105 },
106- hideSummary: Boolean ,
107106 hidePagination: Boolean ,
108107 multipleSortable: Boolean ,
109108})
110109
111110const emit = defineEmits ([' updateSortable' , ' changePage' ])
112111
113- const totalRows = ref (props .totalRows || props .items .length || 0 )
112+ const localTotalRows = ref (props .totalRows || props .items .length || 0 )
114113const fromRow = ref (0 )
115114const toRow = ref (0 )
116115const localCurrentPage = ref (props .currentPage )
@@ -133,11 +132,11 @@ const refreshCounter = () => {
133132 if (localCurrentPage .value === 0 ) {
134133 return
135134 }
136- let from = (totalRows .value > 0 ) ? 1 : 0
135+ let from = (localTotalRows .value > 0 ) ? 1 : 0
137136 if (localCurrentPage .value > 1 ) {
138137 from = from + (localCurrentPage .value - 1 ) * props .perPage
139138 }
140- let to = Math .min (from + props .perPage - 1 , totalRows .value )
139+ let to = Math .min (from + props .perPage - 1 , localTotalRows .value )
141140 fromRow .value = from - 1
142141 toRow .value = to
143142}
0 commit comments