forked from vueComponent/ant-design-vue
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtotal.vue
41 lines (36 loc) · 825 Bytes
/
total.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<docs>
---
order: 7
title:
zh-CN: 总数
en-US: Total number
---
## zh-CN
通过设置 `showTotal` 展示总共有多少数据。
## en-US
You can show the total number of data by setting `showTotal`.
</docs>
<template>
<div>
<a-pagination
v-model:current="current1"
v-model:page-size="pageSize1"
:total="85"
:show-total="total => `Total ${total} items`"
/>
<br />
<a-pagination
v-model:current="current2"
v-model:page-size="pageSize2"
:total="85"
:show-total="(total, range) => `${range[0]}-${range[1]} of ${total} items`"
/>
</div>
</template>
<script lang="ts" setup>
import { ref } from 'vue';
const current1 = ref<number>(1);
const current2 = ref<number>(2);
const pageSize1 = ref<number>(20);
const pageSize2 = ref<number>(20);
</script>