e.subject参数带有count = 0, 尽管拖动的零件已移动到模型中。
在图中:
allowCopy: true,
allowUndo: false,
allowInsert: true,
allowDragOut: true,
allowDrop: true,
allowMove: true,
"ExternalObjectsDropped": (e) => {
this.externalObjectDrop(e);
}
功能:
externalObjectDrop(e) {
e.diagram.commandHandler.deleteSelection();
e.parameter.commandHandler.deleteSelection();
//e.subject.count is 0.
}
答案 0 :(得分:0)
e.subject包含引用而不是值。因此,致电后:e.parameter.commandHandler.deleteSelection()
-e.subject变为空。
所以我将e.subject保存为参数,然后删除选择:
const nodes = e.subject.toArray();
e.parameter.commandHandler.deleteSelection();