a simple draggable directive of Vue Try this demo
npm i vue-draggable-directive --save-dev
import Vue from 'vue'
import VueDraggable from 'vue-draggable-directive'
Vue.use(VueDraggable)
// only draggable
<div v-draggable></div>
// clone
<div v-draggable="{clone: true}"></div>
// ...
key | type | value |
---|---|---|
clone | Boolean | true/false |
boundingRect | Object | {top: x, right: x, bottom: x, left: x} |
onPosChange | Function | Params: type: String: moushDown/MouseMove/MouseUp el: HTMLElement pos: Object: {x: xx, y: yy} |