Skip to content

viotile/vue-draggable

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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}

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%