jerosoler / Drawflow

Simple flow library 🖥️🖱️
https://jerosoler.github.io/Drawflow/
MIT License
4.65k stars 722 forks source link

Node's component is not getting updated [Vue 2] #457

Closed shrey7070 closed 2 years ago

shrey7070 commented 2 years ago

Hi @jerosoler, Thanks for making our life easy. 🥇 I am working on Vue 2 and Made the flow as per my requirement. For updating the Node data I am using this.editor.updateNodeDataFromId(id,data) . which is updating the draw flow object. but the issue is that I am unable to update the content in the Node's component. For example before update:

image after update: - Drawflow object updated but node component is not

image

Thanks in advance :)

jerosoler commented 2 years ago

Hello! Thanks!

updateNodeDataFromId not refresh component.

View: https://github.com/jerosoler/Drawflow/issues/37#issuecomment-717822302

shrey7070 commented 2 years ago

And It worked! :) Thanks again @jerosoler

I do have the following question, After importing the Nodes, Connectors and Lines are not coming into alignment/Sync, could you please help me with that?

image

Thanks Again :)

jerosoler commented 2 years ago

View:

shrey7070 commented 2 years ago

hi @jerosoler,

Thanks for the quick response.

I tried with using this.editor.updateConnectionNodes('node-2'), but it is not doing anything. then I tried to console this.editor.updateConnectionNodes(), but it is showing as undefined.

jerosoler commented 2 years ago

Is editor.updateConnectionNodes('node-2') without this

shrey7070 commented 2 years ago

As I am using Vue js, I am getting an error called "editor is not defined" without using this Actually, I tried with this.editor.removeConnectionNodes('node-2'), and it is working fine. but the update method is not working

shrey7070 commented 2 years ago

Hi @jerosoler, I used the setTimeout function to updateConnecttionNodes and it is working fine

Thanks for your help.