npm.io
1.0.2 • Published 8 years ago

vue-draggable-directive

Licence
MIT
Version
1.0.2
Deps
0
Size
25 kB
Vulns
0
Weekly
0
Stars
3

image

vue-draggable

a simple draggable directive of Vue Try this demo

How to use

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>
// ...

API(Directive Value)

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}

Keywords