jerosoler / Drawflow

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

How to update node information outside it #741

Open capoia opened 11 months ago

capoia commented 11 months ago

Hello, in my project the changes and configurations of the note are made via a sidebar and I use VUE, so as not to have a sidebar inside each node I put a single sidebar outside the nodes, and when clicking on the node I use an EventBus to populate the correct sidebar. My problem is when updating the information through the sidebar, how do I update the node? I'm thinking of doing this using EventBus as well, but I don't know if it's the best way.

jerosoler commented 11 months ago

There isn't just one way.

You just have to get to the updateNodeDataFromId function.

In vue 3 you can see an example here, in this case without event bus. https://github.com/jerosoler/drawflow-vue3-example