From 5a7dfe2f77d29a78ffca844f01c6b060e76336b9 Mon Sep 17 00:00:00 2001 From: DroganCen <32896700+DroganC@users.noreply.github.com> Date: Mon, 18 Dec 2023 17:10:39 +0800 Subject: [PATCH] Update Pagination.tsx MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 外传一个originalPage,解决自定义分页页数下的其他特殊场景问题; --- src/Pagination.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Pagination.tsx b/src/Pagination.tsx index 31626e2e..f9492aff 100644 --- a/src/Pagination.tsx +++ b/src/Pagination.tsx @@ -202,6 +202,7 @@ const Pagination: React.FC<PaginationProps> = (props) => { function handleChange(page: number) { if (isValid(page) && !disabled) { const currentPage = calculatePage(undefined, pageSize, total); + let originalPage = page; let newPage = page; if (page > currentPage) { newPage = currentPage; @@ -214,7 +215,7 @@ const Pagination: React.FC<PaginationProps> = (props) => { } setCurrent(newPage); - onChange?.(newPage, pageSize); + onChange?.(newPage, pageSize, originalPage); return newPage; }