Multiple source positions (Drag & Drop example) #1382
-
Hello, I used the Drag & Drop example available in the documentation.
Could you explain to me how I can have two source positions while retaining the same logic as the example. Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
You need to use a custom node for that. Check the custom node example on how to implement it. Basically use the Handle component, set a unique id for the handle, define what type of handle it is and the position To target the handle with an edge you will have to use {
id: 'e1a-2',
source: '1',
target: '2',
sourceHandle: 'handle-a'
} |
Beta Was this translation helpful? Give feedback.
You need to use a custom node for that.
Check the custom node example on how to implement it.
Basically use the Handle component, set a unique id for the handle, define what type of handle it is and the position
<Handle :id="uniqueHandleId" type="source" :position="Position.Top">
.To target the handle with an edge you will have to use
sourceHandle
/targetHandle
to specify which handle the edge belongs to.