1. 程式人生 > >React —— antd Table元件 分頁Pagination

React —— antd Table元件 分頁Pagination

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

https://www.cnblogs.com/jenifurs-blog/p/6020737.html