formkit / drag-and-drop

https://drag-and-drop.formkit.com
MIT License
1.42k stars 25 forks source link

Vue example, on how to listen to events (dragStart, dragEnd, etc.)? #98

Closed childonline closed 1 month ago

childonline commented 1 month ago

What the title says, I can't figure for the life of me how to listen to event using the Vue composable. The docs weren't much help either.

Nothing seems to trigger with this approach:


const [dragAndDropRef, campaigns] = useDragAndDrop<Campaign>([], {
  onSort: () => {
    console.log('onSort')
  },
  onTransfer: () => {
    console.log('onTransfer')
  },
  onDragstart: () => {
    console.log('onDragstart')
  },
  onDragend: () => {
    console.log('onDragend')
  },
})```
sashamilenkovic commented 1 month ago

@childonline Issue about this here: https://github.com/formkit/drag-and-drop/issues/46

childonline commented 1 month ago

@childonline Issue about this here: #46

thanks for the quick answer! got it working finally