【发布时间】:2022-11-06 16:33:02
【问题描述】:
我正在使用 antd 向表格添加分页。这是以下代码
const columns = [
{
title: "Name",
dataIndex: "name",
width: 150
},
{
title: "Age",
dataIndex: "age",
width: 150
},
{
title: "Address",
dataIndex: "address"
}
];
const data = [];
for (let i = 0; i < 100; i++) {
data.push({
key: i,
name: `Edward King ${i}`,
age: 32,
address: `London, Park Lane no. ${i}`
});
}
const App = () => (
<Table
columns={columns}
dataSource={data}
pagination={{
pageSizeOptions: [5, 10, 15, 20],
defaultPageSize: 5
}}
/>
);
我希望将 5 人/页(如附图所示)定制为 5 人/页。 5/page 是默认出现的,但我如何根据我的要求自定义它?我检查了分页的属性,但我不知道该怎么做。
【问题讨论】:
标签: javascript node.js reactjs pagination antd