feat(web): table support pagesize

This commit is contained in:
zhaoying
2026-04-14 17:59:24 +08:00
parent 5e6490213d
commit 3e48d620b2
2 changed files with 4 additions and 3 deletions

View File

@@ -2,7 +2,7 @@
* @Author: ZhaoYing
* @Date: 2026-02-02 15:29:46
* @Last Modified by: ZhaoYing
* @Last Modified time: 2026-03-26 14:52:23
* @Last Modified time: 2026-04-14 17:55:15
*/
/**
* RbTable Component
@@ -27,7 +27,7 @@ import { useTranslation } from 'react-i18next';
import { request } from '@/utils/request';
import Empty from '@/components/Empty';
interface TablePaginationConfig { pagesize: number; page: number; }
interface TablePaginationConfig { pagesize?: number; page?: number; }
/** Props interface for Table component */
interface TableComponentProps<T = Record<string, unknown>, Q = Record<string, unknown>> extends Omit<TableProps<T>, 'pagination'> {
@@ -102,7 +102,7 @@ const RbTable = forwardRef(<T = Record<string, unknown>, Q = Record<string, unkn
const [loading, setLoading] = useState(false)
const [currentPagination, setCurrentPagination] = useState({
page: 1,
pagesize: 20,
pagesize: typeof pagination === 'object' ? (pagination.pagesize || 20) : 20,
});
const [total, setTotal] = useState(0);

View File

@@ -120,6 +120,7 @@ const Index = () => {
rowKey="id"
bordered={false}
scrollY="100%"
pagination={{pagesize: 10}}
/>
</div>
</Flex>