-
Notifications
You must be signed in to change notification settings - Fork 210
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
feat(autoHide): whether to auto hide the pagination component #105
Conversation
autoHide is true and pageSizeOptions [0]> total does not display pagination update the doc and demo
devui/pagination/doc/api-en.md
Outdated
@@ -37,7 +37,8 @@ In the page: | |||
| lite | `boolean` | false | Optional. Specifies Whether to switch to the simplified mode. | [Simplified mode](demo#minimalist-model) | | |||
| showPageSelector | `boolean` | true | Optional. Whether to display the page number drop-down list in simplified mode. | [Simplified mode](demo#minimalist-model) | | |||
| haveConfigMenu | `boolean` | false | Optional. Whether to display the configuration in simplified mode | [Simplified mode](demo#minimalist-model) | | |||
| autoFixPageIndex | `boolean` | true | Optional. Indicates whether to automatically correct the page number when the page size is changed. If the pageIndex is processed in the `pageSizeChange` event, you are advised to set the value to `false` | [Simplified Mode](demo#minimalist-model) |. | |||
| autoFixPageIndex | `boolean` | true | Optional. Indicates whether to automatically correct the page number when the page size is changed. If the pageIndex is processed in the `pageSizeChange` event, you are advised to set the value to `false` | [Simplified Mode](demo#minimalist-model) | | |||
| autoHide | `boolean` | false | Optional, whether to hide automatically, autoHide is true and pageSizeOptions[0] > total do not show pagination | [Simplified Mode](demo#minimalist-model) |. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
很易用的功能点~
@@ -1,4 +1,4 @@ | |||
<div class="devui-pagination"> | |||
<div class="devui-pagination" [hidden]="!(autoHide && pageSizeOptions[0] < total)"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
组件并未严格限定pageSizeOption是从小到大排序,这个判断可能有些许不严谨,需要页数小于pageSizeOption中的最小值是隐藏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
重新commit了判断了最小值,请再review 下是否合理
@@ -1,4 +1,4 @@ | |||
<div class="devui-pagination"> | |||
<div class="devui-pagination" [hidden]="!(autoHide && minPageSizeOptions < total)"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
判定条件有问题,Demo中Pagination默认都隐藏了
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已修改为 [hidden]="autoHide && total < minPageSizeOptions"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
判断pageSizeOptions最小值
autoHide is true and pageSizeOptions [0]> total does not display pagination
update the doc and demo