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

Add pagerCount props #162

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open

Conversation

liuchuzhang
Copy link

@ant-design-bot
Copy link

ant-design-bot commented Feb 22, 2019

Deploy preview for rc-pagination failed.

Built with commit 9a55e81

https://app.netlify.com/sites/rc-pagination/deploys/5c809ff6d1d694000831e739

@coveralls
Copy link

coveralls commented Feb 22, 2019

Coverage Status

Coverage increased (+0.9%) to 90.119% when pulling 9a55e81 on liuchuzhang:jump into 4b1c6b2 on react-component:master.

@yoyo837
Copy link
Member

yoyo837 commented Feb 25, 2019

只做了隐藏,应该再添加设置最大分页跨度来约束最大可跨范围来达到 ant-design/ant-design#14683 (comment) 的想法

@liuchuzhang
Copy link
Author

@yoyo837 好的。

@liuchuzhang liuchuzhang changed the title Add bonudary jumper hide api Add hideBonudary, pagerCount props Feb 26, 2019
@liuchuzhang
Copy link
Author

@afc163 这个向后 5 页title 该怎么弄😄

@liuchuzhang
Copy link
Author

@yoyo837 像这种语言也不知道用不用阿拉伯数字
我看 element ui 没有 title
是要牺牲这个 title 还是有别的语言方案解决?

image
image
image

@yoyo837
Copy link
Member

yoyo837 commented Feb 26, 2019

你准备加什么

@liuchuzhang
Copy link
Author

@yoyo837 你好,我是说这个把这个按钮数量设置为 10 的话, 向前 5 页将是向前 10 页。title 也要随之改变。
title 是鼠标 hover 在这里的 title。
image

@afc163
Copy link
Member

afc163 commented Feb 26, 2019

我是说这个把这个按钮数量设置为 10 的话, 向前 5 页将是向前 10 页

这个按钮数量设置为 10 也保持向前向后 5 页吧,就是两者不关联。

@yoyo837
Copy link
Member

yoyo837 commented Feb 26, 2019

可以一直保持向前x页、向后x页吧。另外添加国际化的话一般做法是不知道怎么翻译就保留国际语言英语。

@liuchuzhang
Copy link
Author

@afc163 这样子吗,我感觉要有 10 个按钮的话向前 10 页更好啊😄

examples/default.js Outdated Show resolved Hide resolved
@zombieJ
Copy link
Member

zombieJ commented Feb 26, 2019

我感觉有 pagerCount 就够了,剩下的改进一下 itemRender 可以做出来这个效果。不一定要额外的 hideBonudary。

@liuchuzhang
Copy link
Author

@zombieJ 请问现在是不要 hideBonudary ,同时按钮数量设置为 10 也保持向前向后 5 页。
另外我看现有的 itemRender 是在按钮的内部进行自定义,我们是要改进 itemRender 自定义整个按钮吗?

@zombieJ
Copy link
Member

zombieJ commented Feb 27, 2019

@zombieJ 请问现在是不要 hideBonudary ,同时按钮数量设置为 10 也保持向前向后 5 页。
另外我看现有的 itemRender 是在按钮的内部进行自定义,我们是要改进 itemRender 自定义整个按钮吗?

itemRender 返回 null 时就不渲染这个 Pager,因为我们的按钮是:
Left First Jumper Pages Jumper Last Right

按照需求,我们只要改成:
Left Pages Right

然后改写 Left 和 Right 的逻辑从 1 页改成 n 页就行了。

@liuchuzhang
Copy link
Author

@zombieJ 抱歉昨天有点忙,请 review 一下。
例子在 pagerCount.html

@liuchuzhang
Copy link
Author

然后改写 Left 和 Right 的逻辑从 1 页改成 n 页就行了。

这个就没必要了因为 ant-design/ant-design#14683 他说的是类似百度那种,百度的 Left 和 Right 是只跳一页的。

@zombieJ
Copy link
Member

zombieJ commented Feb 28, 2019

CI broken...

@liuchuzhang
Copy link
Author

咋回事 我只删掉了一行文档

@zombieJ
Copy link
Member

zombieJ commented Feb 28, 2019

本地跑看看能过不?

@liuchuzhang
Copy link
Author

过了一次, 然后又过不了了, 我好像发现了 Bug 我下午弄一下

src/Pager.jsx Outdated Show resolved Hide resolved
src/Pagination.jsx Outdated Show resolved Hide resolved
@zombieJ
Copy link
Member

zombieJ commented Mar 1, 2019

加些 test case 来测一下新的计算方式和以前在生成 pager 的数量上是否相同。多搞一些边界值测测~

@liuchuzhang
Copy link
Author

@zombieJ pagerCount 需要大于 3 是否要在文档中体现。

@liuchuzhang
Copy link
Author

不能小于 3,小于 3 不好翻页了。

@zombieJ
Copy link
Member

zombieJ commented Mar 1, 2019

不能小于 3,小于 3 不好翻页了。

还有前一页/后一页按钮可以点~

src/Pagination.jsx Outdated Show resolved Hide resolved
@liuchuzhang
Copy link
Author

@zombieJ

@zombieJ
Copy link
Member

zombieJ commented Mar 5, 2019

加些 test case 来测一下新的计算方式和以前在生成 pager 的数量上是否相同。多搞一些边界值测测~

@liuchuzhang liuchuzhang force-pushed the jump branch 2 times, most recently from ab4346b to f76eb56 Compare March 7, 2019 04:05
@liuchuzhang liuchuzhang changed the title Add hideBonudary, pagerCount props Add pagerCount props Mar 7, 2019
@afc163
Copy link
Member

afc163 commented Mar 13, 2020

冲突了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants