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

feat(Tree): add renderChildNodes prop #1273

Merged
merged 2 commits into from Nov 14, 2019

Conversation

myronliu347
Copy link
Member

No description provided.

@codecov
Copy link

codecov bot commented Oct 28, 2019

Codecov Report

Merging #1273 into feat/1.19.0 will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@               Coverage Diff               @@
##           feat/1.19.0    #1273      +/-   ##
===============================================
+ Coverage        90.95%   90.96%   +<.01%     
===============================================
  Files              260      260              
  Lines            14346    14348       +2     
  Branches          4577     4576       -1     
===============================================
+ Hits             13049    13051       +2     
  Misses            1275     1275              
  Partials            22       22
Impacted Files Coverage Δ
src/tree/view/tree.jsx 91.1% <ø> (ø) ⬆️
src/tree/view/tree-node.jsx 93.47% <100%> (+0.05%) ⬆️
src/message/toast.jsx 82.5% <0%> (ø) ⬆️

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 8e44dc9...76ae7ff. Read the comment docs.

@@ -0,0 +1,79 @@
# 平铺叶子节点

- order: 2
Copy link
Member

Choose a reason for hiding this comment

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

order决定了当前demo在最终demo页面上的顺序,不要有重复,已经有order2了

:::lang=en-us
# Tile leaf nodes

- order: 2
Copy link
Member

Choose a reason for hiding this comment

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

同上

render() {
return <Tree checkable renderChildNodes={(nodes) => {
if (nodes.filter((node) => !node.props.children || node.props.children.length === 0).length !== nodes.length) {
return null;
Copy link
Member

Choose a reason for hiding this comment

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

renderChildNodes 返回null 表示按照原状态渲染有点奇怪,看下是改实现还是改api名字

if (nodes.filter((node) => !node.props.children || node.props.children.length === 0).length !== nodes.length) {
return null;
}
return <ul className="next-tree-child-tree custom-leaf-tree">{nodes}</ul>
Copy link
Member

Choose a reason for hiding this comment

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

    @youluna youluna merged commit aede069 into alibaba-fusion:feat/1.19.0 Nov 14, 2019
    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