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

tree 设置选中节点是否为叶子结点,出现问题 #4037

Closed
Cyclone77 opened this issue Aug 21, 2019 · 1 comment · Fixed by #4289
Closed

tree 设置选中节点是否为叶子结点,出现问题 #4037

Cyclone77 opened this issue Aug 21, 2019 · 1 comment · Fixed by #4289
Assignees

Comments

@Cyclone77
Copy link

Reproduction link

https://stackblitz.com/edit/angular-bjj7fm?file=src/app/app.component.ts

Steps to reproduce

设置nzTree的nzClick后拿到点击节点赋值给this.activedNode,设置this.activedNode.isLeaf = isLeaf;节点并没有改变。
但是如果在后面改变 this.activedNode.title = ( new Date()) ''; 节点文本,isLeaf 也生效了。

What is expected?

this.activedNode.isLeaf = isLeaf;是可以生效的

What is actually happening?

this.activedNode.isLeaf = isLeaf;并没有生效

Environment Info
ng-zorro-antd 7.5.1
Browser google 76

例子中点击按钮并没有反应,如果改变代码:

setTreeisLeaf(isLeaf) {
    this.activedNode.isLeaf = isLeaf;
    // this.activedNode.title = (  new Date())   '';
  }

打开注释代码,再次点击就能实现。

@zorro-bot
Copy link

zorro-bot bot commented Aug 21, 2019

Translation of this issue:

Tree Sets whether the selected node is a leaf node, and there is a problem.

Reproduction link

[https://stackblitz.com/edit/angular-bjj7fm?file=src/app/app.component.ts](https://stackblitz.com/edit/angular-bjj7fm?file=src/app/app. Component.ts)

Steps to reproduce

After setting nzTree's nzClick, get the click node assignment to this.activedNode and set this.activedNode.isLeaf = isLeaf; the node has not changed.
But if you change the this.activedNode.title = ( new Date()) ''; node text later, isLeaf will also take effect.

What is expected?

this.activedNode.isLeaf = isLeaf; is valid

What is actually happening?

this.activedNode.isLeaf = isLeaf; does not take effect

Environment Info
ng-zorro-antd 7.5.1
Browser google 76

In the example, clicking the button does not respond, if you change the code:

setTreeisLeaf(isLeaf) {
    this.activedNode.isLeaf = isLeaf;
    // this.activedNode.title = ( new Date()) '';
  }

Open the comment code and click again to do it.

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

Successfully merging a pull request may close this issue.

2 participants