1.0.1 • Published 7 years ago

vue-dnd2 v1.0.1

Weekly downloads
4
License
MIT
Repository
github
Last release
7 years ago

VUE-DND2


A clone Vue Drag n' Drop now supported by VueJS v2

The whole concept of this plugin was made based on the already existing Lain-dono - Now supported by v2 of VueJS

Install

npm install vue-dnd2 --save

Usage

Vue.use(require('vue-dnd2'))

Add the drag n' drop directive to the elements that will accept this usability. You can decide which elements will be able to be draggable or droppable or both.

Draggable sintax

<div v-draggable.cart="{product_id: item.id, price: item.price}"></div>
ParamValue
cartThe Group. You can choose a group of elements that will interact with drag n 'drop
product_idThe Key object. A key object that will be passed to droppable element
item.idThe Value.

Droppable sintax

<div v-droppable.cart="foo"></div>
...
methods: {
  foo: function ($ev) {
    // $ev contains the draggable object
  }
}
ParamValue
cartThe Group. You can choose a group of elements that will interact with drag n 'drop
fooThe Function. The function that will be called when the same group element is dropped in the droppable container