修复分页器
This commit is contained in:
@@ -85,16 +85,20 @@ export function useTable<A extends AntDesign.TableApiFn>(config: AntDesign.AntDe
|
|||||||
// size: 'f',
|
// size: 'f',
|
||||||
current: 1,
|
current: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
|
defaultPageSize: 10,
|
||||||
|
responsive: true,
|
||||||
onChange: async (current: number, pageSize: number) => {
|
onChange: async (current: number, pageSize: number) => {
|
||||||
pagination.current = current;
|
pagination.current = current;
|
||||||
|
pagination.pageSize = pageSize;
|
||||||
updateSearchParams({
|
updateSearchParams({
|
||||||
pageNum: current,
|
pageNum: current,
|
||||||
pageSize
|
pageSize
|
||||||
});
|
});
|
||||||
|
|
||||||
getData();
|
getData();
|
||||||
}
|
},
|
||||||
|
showTotal: (total: number) =>
|
||||||
|
$t('common.tablePaginationTotal', { total: total })
|
||||||
});
|
});
|
||||||
|
|
||||||
// this is for mobile, if the system does not support mobile, you can use `pagination` directly
|
// this is for mobile, if the system does not support mobile, you can use `pagination` directly
|
||||||
|
|||||||
@@ -66,7 +66,8 @@ const local: any = {
|
|||||||
yesOrNo: {
|
yesOrNo: {
|
||||||
yes: 'Yes',
|
yes: 'Yes',
|
||||||
no: 'No'
|
no: 'No'
|
||||||
}
|
},
|
||||||
|
tablePaginationTotal: 'Total {total} items',
|
||||||
},
|
},
|
||||||
request: {
|
request: {
|
||||||
logout: 'Logout user after request failed',
|
logout: 'Logout user after request failed',
|
||||||
|
|||||||
@@ -66,7 +66,8 @@ const local:any = {
|
|||||||
yesOrNo: {
|
yesOrNo: {
|
||||||
yes: '是',
|
yes: '是',
|
||||||
no: '否'
|
no: '否'
|
||||||
}
|
},
|
||||||
|
tablePaginationTotal: '总共 {total} 条',
|
||||||
},
|
},
|
||||||
request: {
|
request: {
|
||||||
logout: '请求失败后登出用户',
|
logout: '请求失败后登出用户',
|
||||||
|
|||||||
Reference in New Issue
Block a user