jerosoler / Drawflow

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

custom method #90

Closed linpan closed 3 years ago

linpan commented 3 years ago

proposal: add method 1.get input or out node

jerosoler commented 3 years ago

Hello @linpan

You can access that information with:

getNodeFromId(id)
creyeschaponan commented 3 years ago

Hello @jerosoler

I would like to know how I can dynamically store the id when I do the event: nodeRemoved, since there I get the id, but how can I store that id inside a vue variable,

I send what I want to do

this.$df.on('nodeRemoved', function(id){
          console.log(id);
          vue var = id; //  I want to do this so that when I delete store in a variable or in an array with the id of nodes removed
      });
jerosoler commented 3 years ago

Hello @creyeschaponan

Save in data component (https://vuejs.org/v2/guide/components.html#Base-Example) or vuex.

Use arrow function to store in data: https://github.com/jerosoler/Drawflow/issues/65#issuecomment-726160493