ant design 分页中文字_ant design 中的table中的分页

{base ?

simple:false,

current:basePagination.current,

total:basePagination.total,

pageSizeOptions:['10','20','30','40','50'],

showSizeChanger:true,

pageSize:basePagination.pageSize,

showTotal: (count=basePagination.total)=>{return '共'+count+'条数据'},//onChange:ChangePage(),

onChange:(current,pageSize)=>{

onBaseClick(current,pageSize)

}

}}/> : }

调用的方法(分页点击的):

functiononBaseClick(current,pageSize){

dispatch({

type:"customerProtectLog/queryBase",

payload: {

current:current,

pageSize:pageSize

}

})

}

这个只是一个table的展示,其中这里面自己遇到的问题有:

1、pageSizeOptions不显示,这个可以看官网,数组是字符串数组,所以参数要传正确

2、还有就是方法onChange,这里遇到的问题是注释掉的代码,调用这个会持续请求后端接口    结果浏览器卡住。。。

3、注意自己调用参数的顺序,这都是坑

------------------------------------------------------------------------------------------

index部分代码

const listProps ={

list: list,//loading: loading.effects['customerProtectLog/queryBase'],

pagination:pagination,

location,

currentType:currentType,

onChange (page) {

。。。}return(

ddss

ddssddss } key="1" >

{var0}

{ dispatch({ type: 'customerProtectLog/exportFile', payload: { id: 1, name: "ddss" } }); }}> 导出

)

这里调用了list文件,代码如下:

return(

{...listProps}

dataSource={list}

className={classnames({ [styles.table]: true})}

bordered

scroll={{ x: 100}}

columns={getColumns()}//simple

rowKey={record => record.timestamp + '' + record.module + '' +generalKey()}//components={getBodyWrapper}

pagination={{

simple:false,

current: listProps.pagination.current,

total: listProps.pagination.total,

pageSizeOptions: ['10', '20', '30', '40', '50'],

showSizeChanger:true,

pageSize: listProps.pagination.pageSize,

showTotal: (count= listProps.pagination.total) =>{return '共' + count + '条数据'},

onChange: (page,currentType)=>{

},

}}/>

)

这里算是半个闭环,就是总结给自己看得;

其他关于pagination可以在官网上查到;

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值