vue-dnd2

1.0.1 • Public • Published

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>
Param Value
cart The Group. You can choose a group of elements that will interact with drag n 'drop
product_id The Key object. A key object that will be passed to droppable element
item.id The Value.

Droppable sintax

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

Package Sidebar

Install

npm i vue-dnd2

Weekly Downloads

1

Version

1.0.1

License

MIT

Last publish

Collaborators

  • fagneraraujo