mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-04 17:09:46 +08:00
6776bb8916
* docs: update demo * chore: add script * test: fix demo test * docs: convert demos * chore: move script * test: remove react-dom import * chore: update deps * docs: update riddle js * test: fix image test * docs: fix riddle demo
37 lines
612 B
Markdown
37 lines
612 B
Markdown
---
|
|
order: 9
|
|
title:
|
|
zh-CN: 总数
|
|
en-US: Total number
|
|
---
|
|
|
|
## zh-CN
|
|
|
|
通过设置 `showTotal` 展示总共有多少数据。
|
|
|
|
## en-US
|
|
|
|
You can show the total number of data by setting `showTotal`.
|
|
|
|
```jsx
|
|
import { Pagination } from 'antd';
|
|
|
|
export default () => (
|
|
<>
|
|
<Pagination
|
|
total={85}
|
|
showTotal={total => `Total ${total} items`}
|
|
defaultPageSize={20}
|
|
defaultCurrent={1}
|
|
/>
|
|
<br />
|
|
<Pagination
|
|
total={85}
|
|
showTotal={(total, range) => `${range[0]}-${range[1]} of ${total} items`}
|
|
defaultPageSize={20}
|
|
defaultCurrent={1}
|
|
/>
|
|
</>
|
|
);
|
|
```
|