svelte-drag-and-drop-actions
svelte-drag-and-drop-actions copied to clipboard
Droppable Passing a JSON structure
Hi, what's the current recommended way of passing a json structure in a droppable?
Is it through DataToOffer passing the structure in stringified format like this:
use:asDroppable={{
Extras: "Text",
relativeTo: "body",
Operations: "copy",
DataToOffer: {
"application/json": '{"type": "custom", "name": "SQL Server"}'
},
onDropped,
}}
And then use JSON.parse() on the "application/json" key once the droppable is dropped?
Is there some better way to do this?
Thanks, Nuno