ant-design/components/pagination/demo/total.md
2020-06-28 15:16:23 +08:00

626 B

order title
9
zh-CN en-US
总数 Total number

zh-CN

通过设置 showTotal 展示总共有多少数据。

en-US

You can show the total number of data by setting showTotal.

import { Pagination } from 'antd';

ReactDOM.render(
  <div>
    <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}
    />
  </div>,
  mountNode,
);