-
官方的事例中用vue是这样写的 this.lf.on('selection:selected,node:click,blank:click,edge:click', () => {
this.$nextTick(() => {
const { nodes, edges } = this.lf.getSelectElements()
this.$set(this, 'activeNodes', nodes)
this.activeNodes = nodes
this.activeEdges = edges
this.$_getProperty()
})
}) 我用react这样写,没有this.$nextTick这个函数,其中边的数据需要点击两次才能获取到 logicflow?.on('selection:selected,node:click,blank:click,edge:click', () => {
const { nodes, edges } = logicflow.getSelectElements()
setActiveNodes(nodes);
setActiveEdges(edges);
getProperty(logicflow)
}) 请问我需要怎样做才能只用点击一次边就可以获取到数据? |
Beta Was this translation helpful? Give feedback.
Answered by
towersxu
May 18, 2023
Replies: 1 comment 1 reply
-
没有nextTick,你就用setTimeout 0试试 |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
jabin0818
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
没有nextTick,你就用setTimeout 0试试