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

fix tree diagram leaves label formatter don't work #11385 #8534 #11556

Merged
merged 3 commits into from Nov 6, 2019

Conversation

deqingli
Copy link
Member

@deqingli deqingli commented Nov 4, 2019

No description provided.

nodeData.wrapMethod('getItemModel', function (model, idx) {
var node = tree.getNodeByDataIndex(idx);
var leavesModel = node.getLeavesModel();
if (node.children.length === 0 || (node.children.length !== 0 && node.isExpand === false)) {
Copy link
Contributor

@pissang pissang Nov 6, 2019

Choose a reason for hiding this comment

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

A small suggestion on optimizing code.

I think this can be simplify to

if (!node.children.length || !node.isExpand) {
}

Copy link
Member Author

@deqingli deqingli Nov 6, 2019

Choose a reason for hiding this comment

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

Thank you for your suggestion, I have fixed it.

pissang
pissang approved these changes Nov 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants