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

List integrate pagination functional fixed: #9303 #10135

Merged
merged 1 commit into from Apr 20, 2018

Conversation

nikogu
Copy link
Contributor

@nikogu nikogu commented Apr 18, 2018

@ant-design-bot
Copy link
Contributor

Deploy preview for ant-design ready!

Built with commit 1663bf5

https://deploy-preview-10135--ant-design.netlify.com

@codecov
Copy link

codecov bot commented Apr 18, 2018

Codecov Report

Merging #10135 into feature-3.5.0 will increase coverage by 0.05%.
The diff coverage is 100%.

Impacted file tree graph

@@                Coverage Diff                @@
##           feature-3.5.0   #10135      +/-   ##
=================================================
+ Coverage          86.28%   86.34%   +0.05%     
=================================================
  Files                197      197              
  Lines               4741     4761      +20     
  Branches            1322     1326       +4     
=================================================
+ Hits                4091     4111      +20     
  Misses               647      647              
  Partials               3        3
Impacted Files Coverage Δ
components/list/index.tsx 97.4% <100%> (+0.91%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 04a5cc2...1663bf5. Read the comment docs.

@nikogu nikogu requested a review from yesmeck April 19, 2018 02:41
);
}
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

截取数据的逻辑是,如果当前获取的数据数目大于当前所需要截取的数量,说明需要进行数据截取,反之则不截取(出现在异步加载情况的数据的情况下)

@@ -163,24 +195,54 @@ export default class List extends React.Component<ListProps> {
[`${prefixCls}-something-after-last-item`]: this.isSomethingAfterLastItem(),
});

this.defaultPaginationProps.total = dataSource.length;
this.defaultPaginationProps.current = paginationCurrent;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

由于默认是不展示分页的,所以需要在 render 中根据 props 情况进行分页的属性设置。

);
if (paginationProps.current > largestPage) {
paginationProps.current = largestPage;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

当 current 大于允许的最大分页时,改 current 为最大分页

@nikogu nikogu requested a review from afc163 April 19, 2018 08:17
@nikogu nikogu merged commit d50ec43 into feature-3.5.0 Apr 20, 2018
@nikogu nikogu deleted the List-integrate-Pagination-functional branch April 20, 2018 07:41
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.

None yet

2 participants