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