|
234 | 234 | <span class="text-sm text-gray-700 dark:text-gray-400"> |
235 | 235 | <span v-if="((page || 1) - 1) * pageSize + 1 > totalRows">{{ $t('Wrong Page') }} </span> |
236 | 236 | <template v-else> |
237 | | - <span class="hidden sm:inline" |
238 | | - v-html="$t('Showing {from} to {to} of {total} Entries', {from: ((page || 1) - 1) * pageSize + 1, to: Math.min((page || 1) * pageSize, totalRows), total: totalRows}) |
239 | | - .replace(/\d+/g, '<strong>$&</strong>')"> |
240 | | - </span> |
241 | | - <span class="sm:hidden" |
242 | | - v-html="$t('{from} - {to} of {total}', {from: ((page || 1) - 1) * pageSize + 1, to: Math.min((page || 1) * pageSize, totalRows), total: totalRows}) |
243 | | - .replace(/\d+/g, '<strong>$&</strong>') |
244 | | - "> |
| 237 | + |
| 238 | + <span class="hidden sm:inline"> |
| 239 | + <i18n-t keypath="Showing {from} to {to} of {total} Entries" tag="p" > |
| 240 | + <template v-slot:from> |
| 241 | + <strong>{{ from }}</strong> |
| 242 | + </template> |
| 243 | + <template v-slot:to> |
| 244 | + <strong>{{ to }}</strong> |
| 245 | + </template> |
| 246 | + <template v-slot:total> |
| 247 | + <strong>{{ totalRows }}</strong> |
| 248 | + </template> |
| 249 | + </i18n-t> |
245 | 250 | </span> |
246 | | - |
| 251 | + <span class="sm:hidden"> |
| 252 | + <i18n-t keypath="{from} - {to} of {total}" tag="p" > |
| 253 | + <template v-slot:from> |
| 254 | + <strong>{{ from }}</strong> |
| 255 | + </template> |
| 256 | + <template v-slot:to> |
| 257 | + <strong>{{ to }}</strong> |
| 258 | + </template> |
| 259 | + <template v-slot:total> |
| 260 | + <strong>{{ totalRows }}</strong> |
| 261 | + </template> |
| 262 | + </i18n-t> |
| 263 | + </span> |
247 | 264 | </template> |
248 | 265 | </span> |
249 | 266 | </div> |
@@ -302,6 +319,8 @@ const page = ref(1); |
302 | 319 | const sort = ref([]); |
303 | 320 |
|
304 | 321 |
|
| 322 | +const from = computed(() => ((page.value || 1) - 1) * props.pageSize + 1); |
| 323 | +const to = computed(() => Math.min((page.value || 1) * props.pageSize, props.totalRows)); |
305 | 324 |
|
306 | 325 | watch(() => page.value, (newPage) => { |
307 | 326 | emits('update:page', newPage); |
|
0 commit comments