@nocyoung/vue-draggable

Vue Drag and Drop component which can be used for PC and H5 without any dependency. Native HTML5 drag and drop implementation made for Vue.
305
Install
npm install @nocyoung/vue-draggable
Latest Version:1.0.6
Vue:2
License:MIT
Last Updated:Feb 9, 2022
Links: npm
Maintainer: nocyoung

vue-draggable

Vue Drag and Drop component which can be used for PC and H5 without any dependency. Native HTML5 drag and drop implementation made for Vue.

Install

yarn add @nocyoung/vue-draggable

Usage

import Draggable from '@nocyoung/vue-draggable';
<Draggable
    :bounds="bounds"
    :defaultPosition="defaultPosition"
    @onUserDragStart="onUserDragStart"
    @onUserDragEnd="onUserDragEnd"
>
    
</Draggable>

bounds: 拖拽的边界, 为上下左右到左上角的距离, 单位为px, 比如:
bounds = { left: 100; right: 100; top:0, bottom:50 }

defaultPosition: 拖拽元素初始位置, 单位为px, 比如:
defaultPosition = { x: 100, y: 200, }

onUserDragStart: 拖拽开始回调,参数为位置坐标
onUserDragEnd: 拖放结束回调,参数为位置坐标

Related Packages

vue3-draggable

simple drag&drop component for vue 3.x

292,920 36
vue-draggable

Vue drag and drop library without any dependency

231,114 302
vue3-drag-and-drop

drag and drop function of vue3

572 0
vue-dnd-zone

Data Driven Drag and Drop functionality for Vue.js

141,989 151
vue-draggable-grid

VueJS Components to move data inside a grid via drag&drop.

9,036

Version History

Version Released Vue License
1.0.6 ^2.5.9 MIT
1.0.5 ^2.5.9 MIT
1.0.4 ^2.5.9 MIT
1.0.3 ^2.5.9 MIT
1.0.2 ^2.5.9 MIT