Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pagination组件endIndex计算错误 #4057

Closed
flucont opened this issue Nov 19, 2022 · 0 comments · Fixed by #4058
Closed

Pagination组件endIndex计算错误 #4057

flucont opened this issue Nov 19, 2022 · 0 comments · Fixed by #4058
Labels
bug Something isn't working

Comments

@flucont
Copy link

flucont commented Nov 19, 2022

TuSimple/naive-ui version (版本)

2.33.5

Vue version (Vue 版本)

3.2.45

Browser and its version (浏览器及其版本)

Chrome

System and its version (系统及其版本)

Windows10

Node version (Node 版本)

Reappearance link (重现链接)

https://github.com/tusen-ai/naive-ui/blob/main/src/pagination/src/Pagination.tsx

Reappearance steps (重现步骤)

在Table中使用Pagination组件,翻到最后一页的时候,endIndex显示的值是错误的

Expected results (期望的结果)

上述链接中的代码
if (itemCount !== undefined) {
return endIndex > itemCount ? itemCount : endIndex;
}
这里的要改成
return endIndex > itemCount - 1 ? itemCount - 1 : endIndex;

Actual results (实际的结果)

Pagination组件endIndex计算错误

Remarks (补充说明)

@github-actions github-actions bot added the untriaged need to sort label Nov 19, 2022
jizai1125 added a commit to jizai1125/naive-ui that referenced this issue Nov 19, 2022
@XieZongChen XieZongChen added bug Something isn't working and removed untriaged need to sort labels Nov 19, 2022
07akioni pushed a commit that referenced this issue Nov 20, 2022
…#4058)

* fix(pagination): `endIndex` calc incorrect, closes #4057

* test(pagination): pagination info
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants