Skip to content

Files

Latest commit

 

History

History
38 lines (26 loc) · 667 Bytes

README.md

File metadata and controls

38 lines (26 loc) · 667 Bytes
description full_title
This tutorial explains how to use the Drag-and-Drop (DnD) APIs.
Drag-and-Drop Tutorial

Drag-and-Drop Tutorial

This tutorial explains how to use the Drag-and-Drop (DnD) APIs.

Usage

Draggable

const {draggable} = core.make('osjs/dnd');

draggable(element, {
  data: {hello: 'World!'}
});

Droppable

const {droppable} = core.make('osjs/dnd');

droppable(element, {
  ondrop: (ev, data) => console.log(data) // => {hello: 'World!'}
});

Usage in Hyperapp

A very basic example:

h(Component, {oncreate: element => draggable(element, {data: {hello: 'World!'}})});