✨ basic ui, some filters
This commit is contained in:
24
ui/Components/Drag/Draggable.js
Normal file
24
ui/Components/Drag/Draggable.js
Normal file
@@ -0,0 +1,24 @@
|
||||
import interact from 'interactjs';
|
||||
|
||||
export default {
|
||||
abstract: true,
|
||||
render() {
|
||||
try {
|
||||
return this.$slots.default[0];
|
||||
} catch (e) {
|
||||
throw new Error('Exactly one child component needed.');
|
||||
}
|
||||
return null;
|
||||
},
|
||||
mounted () {
|
||||
const el = this.$slots.default[0].elm;
|
||||
this.$nextTick(() => {
|
||||
interact(el)
|
||||
.draggable({
|
||||
onmove: (event) => {
|
||||
this.$emit('move', event);
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user