繁体   English   中英

如何在使用antd表的同时检索我们当前所在的页码

[英]How to retrieve the page number we are currently on, while using an antd table

我在 Reactjs 中使用 Antd 创建了一个表。 我每页使用了 50 行,分页中出现了大约 6 页。 我在表中添加了一个索引列,它在每一页上从 1 到 50 循环。 相反,我需要它从 1 循环到全长。 因此,当我导航到第 2 页时,它必须显示 51 到 100,而在我的情况下,它再次从 1 循环到 50。 我使用了从表中的“渲染”函数传递的“索引”。

function indexRenderer(text, record, index) {
    return index+1
}

是否有任何单独的函数可以用来从 antd 的分页中单独检索页数。

您可以使用 Pagination 组件的onChange函数。

它将使用page参数调用。

查看此了解更多信息:

https://ant.design/components/pagination/

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM