ant-design table 分页(tableProps)

1.布局

1
2
3
4
5
6
7
8
9
10
11
12
13
14
<Table
  dataSource={this.state.tableDetailList}
  scroll={{ y: '200px' }}
  style={{tableLayout: 'fixed'}}
  pagination={{ pageSize: 12 }}
  columns={columns1}
  rowKey={record => record.restId}
  pagination={{  // 分页
    simple: true,
    current: this.state.current,
    total: this.state.total2,
    onChange: this.changePage,
  }}
/>

2.逻辑

1
2
3
4
5
6
7
8
9
10
11
12
13
changePage = (page) => {
  this.setState({
    current: page,
  }, () => {
    let param = JSON.parse(JSON.stringify(this.state.param))
    param = {
      ...param,
      pageNum: this.state.current,
      pageSize: 10,
    }
    this.getActivityRestDetailList(param)
  })
}

.

posted @   每天都要进步一点点  阅读(16858)  评论(0编辑  收藏  举报
编辑推荐:
· 对象命名为何需要避免'-er'和'-or'后缀
· SQL Server如何跟踪自动统计信息更新?
· AI与.NET技术实操系列:使用Catalyst进行自然语言处理
· 分享一个我遇到过的“量子力学”级别的BUG。
· Linux系列:如何调试 malloc 的底层源码
阅读排行:
· C# 中比较实用的关键字,基础高频面试题!
· .NET 10 Preview 2 增强了 Blazor 和.NET MAUI
· 为什么AI教师难以实现
· 如何让低于1B参数的小型语言模型实现 100% 的准确率
· AI Agent爆火后,MCP协议为什么如此重要!
历史上的今天:
2017-09-26 vue2.0 仿手机新闻站(七)过滤器、动画效果
点击右上角即可分享
微信分享提示