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

[Bug Report]: 自定义节点继承时initNodeData触发两次的问题 #1983

Open
Web-Li opened this issue Dec 3, 2024 · 1 comment
Open
Labels
bug Something isn't working

Comments

@Web-Li
Copy link

Web-Li commented Dec 3, 2024

发生了什么?

自定义节点继承棱形节点、矩形节点时,initNodeData执行两次。以rect节点为例,initNodeData方法在BaseNodeModel和RectNodeModel的constructor里面均有调用,实际RectNodeModel的constructor里面只调用super即可,现在调用initNodeData会使得用户继承RectNodeModel时,执行两次initNodeData。同样的问题在其他形状节点、或其他方法调用如setAttributes等也有表现,期待统一处理。
image
image

logicflow/core版本

2.0.6

logicflow/extension版本

2.0.10

logicflow/engine版本

No response

浏览器&环境

Chrome

@Web-Li Web-Li added the bug Something isn't working label Dec 3, 2024
@boyongjiong
Copy link
Collaborator

这块儿应该是没有问题的,你可以把我们代码 clone 下来 debug 看一下。你可以试一下,如果把继承的子类(RectNodeModel)这些里面的该方法调用干掉,看我们项目的 demo 会不会有什么问题

然后你可以 debug 一下它的初始化过程,看下子类上定义的属性赋值,会不会有覆盖的情况

欢迎交流

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants