jerosoler / Drawflow

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

Accessing node data from Vue? #114

Closed nodegin closed 3 years ago

nodegin commented 3 years ago

Hello, I added a node with following line editor.addNode('name', 1, 1, pos_x, pos_y, '', { test: 1 }, 'v-component', 'vue');

How can I access test: 1 in Vue v-component?

jerosoler commented 3 years ago

Hello @nodegin

Pass as prop or get Info of node. View: https://github.com/jerosoler/Drawflow/issues/37 and https://github.com/jerosoler/Drawflow/issues/40

Maybe it will also work for you: https://github.com/jerosoler/Drawflow/issues/39

Jero

Jero

nodegin commented 3 years ago

@jerosoler Shouldn't the props passed in addNode? it looks odd passed in registerNode so we cannot really passing node instance's data to vue

nodegin commented 3 years ago

OK I found that we can use this.$el.parentElement.parentElement.id