ant-design table 分页(tableProps)


1.布局

<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.逻辑

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)
  })
}

.


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM