Browse Source

分页tablehooks添加总条数

wanghao 4 months ago
parent
commit
6e7ad07900
1 changed files with 1 additions and 0 deletions
  1. 1 0
      src/hooks/common/table.ts

+ 1 - 0
src/hooks/common/table.ts

@@ -109,6 +109,7 @@ export function useTable<A extends AntDesign.TableApiFn>(config: AntDesign.AntDe
     showSizeChanger: true,
     showSizeChanger: true,
     pageSizeOptions: ['10', '15', '20', '25', '30'],
     pageSizeOptions: ['10', '15', '20', '25', '30'],
     total: 0,
     total: 0,
+    showTotal:total => `共 ${total} 条`,
     onChange: async (current: number, size: number) => {
     onChange: async (current: number, size: number) => {
       pagination.pageIndex = current
       pagination.pageIndex = current
       pagination.pageSize = size
       pagination.pageSize = size