-
使用dnd时,获取到节点的坐标后创建节点,更新节点id,会反复触发 graph.on('node:added', ({ node }) => {}) graph.on('node:added', ({ node }) => { |
Beta Was this translation helpful? Give feedback.
Answered by
qsya
Jan 19, 2022
Replies: 1 comment
-
我在validateNode时获取到了position等信息,新增节点后调用updateCellId,暂时解决了这个问题 |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
qsya
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
我在validateNode时获取到了position等信息,新增节点后调用updateCellId,暂时解决了这个问题
validateNode(droppingNode, options) {
axios.addNode({x,y}).then(res => {
// 更新节点id
graph.updateCellId(graph.getCellById(node.id), res.id)
})
return true
}