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

Projects
None yet
2 participants
@nikogu
Contributor

nikogu commented Apr 18, 2018

#9303

@ant-design-bot

This comment has been minimized.

ant-design-bot commented Apr 18, 2018

Deploy preview for ant-design ready!

Built with commit 1663bf5

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

@codecov

This comment has been minimized.

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 Apr 19, 2018

);
}
}

This comment has been minimized.

@nikogu

nikogu Apr 19, 2018

Contributor

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

@@ -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;

This comment has been minimized.

@nikogu

nikogu Apr 19, 2018

Contributor

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

);
if (paginationProps.current > largestPage) {
paginationProps.current = largestPage;
}

This comment has been minimized.

@nikogu

nikogu Apr 19, 2018

Contributor

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

@nikogu nikogu requested a review from afc163 Apr 19, 2018

@nikogu nikogu merged commit d50ec43 into feature-3.5.0 Apr 20, 2018

6 checks passed

codecov/patch 100% of diff hit (target 86.28%)
Details
codecov/project 86.34% (+0.05%) compared to 04a5cc2
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
deploy/netlify Deploy preview ready!
Details
security/snyk No dependency changes
Details

@nikogu nikogu deleted the List-integrate-Pagination-functional branch Apr 20, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment