How to implement drag and drop for canvas shapes with Vue?
To enable drag&drop for any node on canvas you just need to pass draggable: true
property into the component.
When you drag&drop a shape, it is recommended to save its position in your app store. You can use dragstart
and dragend
events for that purpose.
Instructions: Try to drag the text. Notice how it changes color while being dragged.