1.1.9 • Published 2 years ago

vue2-drag-directive v1.1.9

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

vue-drag-directive npm.io

基于 vue.js 2.x 的拖动指令

说明

  • 将绑定指令的DOM元素以fixed形式设置为可移动
  • 同时支持PC端与移动端

安装

使用 npm 或 yarn 安装:

npm i -S vue2-drag-directive

// or

yarn add vue2-drag-directive

使用

import Vue from 'vue'
import Vue2DragDirective from 'vue2-drag-directive'

Vue.use(Vue2DragDirective)

在你的 .vue 文件中:

<div v-drag>draggable</div>

APIs

指令可接收一个配置对象

属性类型说明函数参数或默认值
isBeyondDocumentBoolean移动时DOM元素是否可以超出文档false
startFunction按下时执行{ top, left, pointX, pointY }
movingFunction拖动时执行{ pointX, pointY, offsetTop, offsetLeft }
endFunction抬起时执行{ pointX, pointY, top, left }

LICENSE

MIT License

1.1.9

2 years ago

1.1.8

2 years ago

1.1.7

2 years ago

1.1.6

2 years ago

1.1.5

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago