You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
963 B
52 lines
963 B
3 years ago
|
<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"
|
||
|
:total="85"
|
||
|
:show-total="total => `Total ${total} items`"
|
||
|
:page-size="20"
|
||
|
/>
|
||
|
<br />
|
||
|
<a-pagination
|
||
|
v-model:current="current2"
|
||
|
:total="85"
|
||
|
:show-total="(total, range) => `${range[0]}-${range[1]} of ${total} items`"
|
||
|
:page-size="20"
|
||
|
/>
|
||
|
</div>
|
||
|
</template>
|
||
|
<script lang="ts">
|
||
|
import { defineComponent, ref } from 'vue';
|
||
|
export default defineComponent({
|
||
|
setup() {
|
||
|
const current1 = ref<number>(1);
|
||
|
const current2 = ref<number>(2);
|
||
|
const onChange = (pageNumber: number) => {
|
||
|
console.log('Page: ', pageNumber);
|
||
|
};
|
||
|
return {
|
||
|
current1,
|
||
|
current2,
|
||
|
onChange,
|
||
|
};
|
||
|
},
|
||
|
});
|
||
|
</script>
|