fix(Pagination): 优化中间页码显示,调整跳转文案格式
- 中间页码:显示当前页前后各1个页码 (如 1...4,5,6...10) - 跳转文案:从"跳转到 [页]"改为"第 [ ] 页"格式 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -60,10 +60,12 @@ const PaginationControl = React.memo(({ currentPage, totalPages, onPageChange })
|
|||||||
pageNumbers.push(i);
|
pageNumbers.push(i);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// 当前页在中间
|
// 当前页在中间:显示当前页前后各1个页码
|
||||||
pageNumbers.push(1);
|
pageNumbers.push(1);
|
||||||
pageNumbers.push('...');
|
pageNumbers.push('...');
|
||||||
pageNumbers.push(currentPage);
|
pageNumbers.push(currentPage - 1); // 前一页
|
||||||
|
pageNumbers.push(currentPage); // 当前页
|
||||||
|
pageNumbers.push(currentPage + 1); // 后一页
|
||||||
pageNumbers.push('...');
|
pageNumbers.push('...');
|
||||||
pageNumbers.push(totalPages);
|
pageNumbers.push(totalPages);
|
||||||
}
|
}
|
||||||
@@ -180,7 +182,7 @@ const PaginationControl = React.memo(({ currentPage, totalPages, onPageChange })
|
|||||||
{/* 输入框跳转 */}
|
{/* 输入框跳转 */}
|
||||||
<HStack spacing={1.5}>
|
<HStack spacing={1.5}>
|
||||||
<Text fontSize="xs" color="gray.600">
|
<Text fontSize="xs" color="gray.600">
|
||||||
跳转到
|
第
|
||||||
</Text>
|
</Text>
|
||||||
<Input
|
<Input
|
||||||
size="xs"
|
size="xs"
|
||||||
@@ -191,10 +193,13 @@ const PaginationControl = React.memo(({ currentPage, totalPages, onPageChange })
|
|||||||
value={jumpPage}
|
value={jumpPage}
|
||||||
onChange={(e) => setJumpPage(e.target.value)}
|
onChange={(e) => setJumpPage(e.target.value)}
|
||||||
onKeyPress={handleKeyPress}
|
onKeyPress={handleKeyPress}
|
||||||
placeholder="页"
|
placeholder=""
|
||||||
bg={buttonBg}
|
bg={buttonBg}
|
||||||
borderColor={borderColor}
|
borderColor={borderColor}
|
||||||
/>
|
/>
|
||||||
|
<Text fontSize="xs" color="gray.600">
|
||||||
|
页
|
||||||
|
</Text>
|
||||||
<Button
|
<Button
|
||||||
size="xs"
|
size="xs"
|
||||||
colorScheme="blue"
|
colorScheme="blue"
|
||||||
|
|||||||
Reference in New Issue
Block a user