antd的table展示total数量

antd的table是可以显示总数量的,筛选后自动变化,需要在pagination中配置:
const paginationProps = {
      showSizeChanger: true,
      showQuickJumper: true,
      total: pagination.totalData, // 数据总数
      pageSize: parseInt(this.state.pageSize), // 每页条数
      current: parseInt(this.state.pageNum), // 当前页码
      showTotal: ((total) => {
        return `共 ${total} 条`;
      }),
    };
<Table
     rowKey={val => val.projectId}
     dataSource={this.state.prolist}
     columns={columns}
     pagination={paginationProps}
     onChange={this.handleStandardTableChange}
/>

猜你喜欢

转载自blog.csdn.net/pingyao_3/article/details/88286955