传入指定的参数,来删除对应节点端口到端口的连线。

如何在外部定义一个按钮,传入指定的参数,来删除对应节点端口到端口的连线,只删除端口到端口的连线,而不删除端口。


比如shang上图,我点击按钮将会删除节点1右侧第二个端口到节点2左侧第二个端口的连线,只删除连线,端口保留。

It appears that you want to delete a link. Somehow you need to choose which link that you want to delete.

Then you can either remove its link data object by calling GraphLinksModel.removeLinkData, or by calling Diagram.remove on the Link itself. Remember to do the removal within a single transaction.


是这种方式吗?我用了removeLinkData没有起作用

You have to remove the actual link data object, the object that is in the GraphLinksModel.linkDataArray, not a copy that might happen to have some of the same properties.