蚂蚁桌子的分页道具 [英] pagination prop for antd table

查看:89
本文介绍了蚂蚁桌子的分页道具的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用antd库中的Table组件.我想将分页道具传递给Table组件.在文档中说通过了分页配置对象,该对象指向分页组件本身.

I am using Table component from antd library. I want to pass pagination prop to the Table component. In the docs it says pass the pagination config object which refers to the Pagination component itself.

因此,我使用分页组件属性名称作为键来传递分页对象,例如 <Table pagination={{pageSizeOptions : ['30', '40'], showPageSizeOptions : true}} {...otherProps} />

So I am passing the pagination object using Pagination component prop names as keys like <Table pagination={{pageSizeOptions : ['30', '40'], showPageSizeOptions : true}} {...otherProps} />

但是当我在react-inspector中检查Table组件时,我没有在组件props中看到分页道具,但是它处于组件状态并且具有默认值.

But when I inspect the Table component in react-inspector I don't see the pagination prop in component props but it is there in the component state and has default values.

如何对表格组件使用分页道具?

How to use the pagination prop for Table component?

推荐答案

将"showPageSizeOptions"替换为"showSizeChanger".

Replace "showPageSizeOptions" to "showSizeChanger".

<Table pagination= { {pageSizeOptions: ['30', '40'], showSizeChanger: true}} rowSelection={rowSelection} columns={columns} dataSource={data} />

这篇关于蚂蚁桌子的分页道具的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆