File tree Expand file tree Collapse file tree 5 files changed +20
-2
lines changed
common-helpers/src/locale Expand file tree Collapse file tree 5 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -198,6 +198,7 @@ export const localeTable: tLocaleTable = {
198
198
export const localePagination : tLocalePagination = {
199
199
pagination_items : "No items | Single item | {count} items" ,
200
200
pagination_pages : "No pages | Single page | {count} pages" ,
201
+ pagination_page : "Page {count} of" ,
201
202
// swal: {},
202
203
} ;
203
204
Original file line number Diff line number Diff line change @@ -199,6 +199,7 @@ export const localeTable: tLocaleTable = {
199
199
export const localePagination : tLocalePagination = {
200
200
pagination_items : "Sin elementos | Único elemento | {count} elementos" ,
201
201
pagination_pages : "Sin páginas | Única página | {count} páginas" ,
202
+ pagination_page : "Página {count} de" ,
202
203
// swal: {},
203
204
} ;
204
205
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ export interface iPageEdge<T, C extends string | number = string> {
16
16
export interface iPageInfo < C extends string | number = string > {
17
17
nextCursor ?: C ;
18
18
previousCursor ?: C ;
19
+ pageNumber ?: number ;
19
20
hasNextPage : boolean ;
20
21
hasPreviousPage : boolean ;
21
22
path ?: string ;
Original file line number Diff line number Diff line change @@ -299,6 +299,8 @@ export type tLocalePagination = {
299
299
pagination_items : string ;
300
300
/** @example "No pages | Single page | {count} pages" */
301
301
pagination_pages : string ;
302
+ /** @example "Page {count} of" */
303
+ pagination_page : string ;
302
304
// swal: {};
303
305
} ;
304
306
Original file line number Diff line number Diff line change 10
10
<p class =" --txtSize-sm" >
11
11
{{ t("pagination_items", currentPage.totalCount) }}
12
12
⋅
13
- {{ t("pagination_pages", Math.ceil(currentPage.totalCount / modelValue.first)) }}
13
+ {{ pageCountText }}
14
14
</p >
15
15
</li >
16
16
<li v-if =" !hidePageLength && currentPage.totalCount > 5" >
113
113
* PaginationSimple first model
114
114
*/
115
115
const firstModel = computed ({
116
- get : () => props .modelValue ?.first ?? defaultFirst ,
116
+ get : () => props .modelValue ?.first ?? defaultFirst ?? 0 ,
117
117
set(first ) {
118
118
emit (" update:model-value" , { ... props .modelValue , first });
119
119
},
120
120
});
121
+
122
+ const pageCountText = computed (() => {
123
+ const totalCount = props .currentPage ?.totalCount ?? 0 ;
124
+ const pagesText = t (" pagination_pages" , Math .ceil (totalCount / firstModel .value ));
125
+
126
+ if (! props .currentPage ?.pageInfo .pageNumber ) {
127
+ const pageText = t (" pagination_page" , props .currentPage ?.pageInfo .pageNumber );
128
+
129
+ return ` ${pageText } ${pagesText } ` ;
130
+ }
131
+
132
+ return pagesText ;
133
+ });
121
134
</script >
You can’t perform that action at this time.
0 commit comments