Skip to content

Commit 3f0a20c

Browse files
authored
删除节点&删除线构造参数改成通过id的方式
1 parent ff8140f commit 3f0a20c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,13 +256,13 @@ export default class MonitorDag extends React.Component<ComProps, any> {
256256
this.canvas.addNodes(diffInfo.addNodes);
257257
}
258258
if (diffInfo.rmNodes.length > 0) {
259-
this.canvas.removeNodes(diffInfo.rmNodes);
259+
this.canvas.removeNodes(diffInfo.rmNodes.map(item => item.id));
260260
}
261261
if (diffInfo.addEdges.length > 0) {
262262
this.canvas.addEdges(diffInfo.addEdges);
263263
}
264264
if (diffInfo.rmEdges.length > 0) {
265-
this.canvas.removeEdges(diffInfo.rmEdges);
265+
this.canvas.removeEdges(diffInfo.rmEdges.map(item => item.id));
266266
}
267267
if (diffInfo.updateStatus.length > 0) {
268268
diffInfo.updateStatus.forEach((item) => {

0 commit comments

Comments
 (0)