2.0.4 • Published 3 years ago

vue-drag-plugin v2.0.4

Weekly downloads
18
License
ISC
Repository
github
Last release
3 years ago

A Vue.js drag plugin

Support

  • Vue.js : 2.x
  • Browser: only work in Desktop browser,will consider Mobile browser in the future version

Installation

npm i vue-drag-plugin

Usage

Configuartion

you need to import plugin in your main.js

import Vue from 'vue'
import VueDragPlugin from "vue-drag-plugin"
Vue.use(VueDragPlugin)

set the css property width and height to limit the space that maybe be manipulated on ,for example:

<v-drag style="width:800px;height:200px;">

Props

nametypedescription
visiblerequired:booleanvisibility of the drag shape
drawEnableoptional:booleanwhether or not you can draw a new shape with mouse in the blank,default:false
selectWidthoptional:numberwidth of the drag shape,default:0
selectHeightoptional:numberwidth of the drag shape,default:0
offsetLeftoptional:numberoffset relative to the plugin 's X axis,default:0
offsetTopoptional:numberoffset relative to the plugin 's Y axis,default:0

Events

nameparamsdescription
onShapeDragthe new size、position of shapewhen shape has been draged
onShapeResizethe new size、position of shapewhen shape has been resized
onShapeDrawthe new size、position of shapewhen a new shape created

Examples

you can checkout Demo here

2.0.3

3 years ago

2.0.2

3 years ago

2.0.4

3 years ago

2.0.1

3 years ago

1.0.2

3 years ago

2.0.0

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago