Skip to content

Latest commit

 

History

History
31 lines (26 loc) · 764 Bytes

README.md

File metadata and controls

31 lines (26 loc) · 764 Bytes

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}