I am trying to check out the aurelia-dragula plugin to see if it meets my needs, but when I attempt to drag what should be a draggable element, nothing happens. I have even tried the example and it doesn't work either.
For my custom test, I created a new project using the aurelia cli and npm installed aurelia-dragula 1.2.6. Here's my code:
aurelia.json
{
"name": "aurelia-dragula",
"path": "../node_modules/aurelia-dragula/dist/amd",
"main": "dragula"
}
main.js
aurelia.use
.standardConfiguration()
.feature('resources')
.plugin('aurelia-dragula');
The browser log shows the plugin as being loaded, so I assume all is well with the above.
I used the sample html and javascript from the documentation for the custom-element approach, like so:
app.html
<template>
<dragula-and-drop drop-fn.call="itemDropped(item, target, source, sibling, itemVM, siblingVM)"></dragula-and-drop>
<div class="drag-source drop-target">
<div repeat.for="thing of things">
<p style="background-color: red; color: white; width: 200px;"">${thing}</p>
</div>
</div>
</template>
app.js
export class App {
constructor() {
this.things = ['1', '2', '3', '4'];
}
itemDropped(item, target, source, sibling, itemVM, siblingVM) {
//do things in here
}
}