JSPM

vue-dnd2

1.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q20604F
  • License MIT

A clone Vue Drag n' Drop now supported by 2.0 version of VueJS

Package Exports

  • vue-dnd2

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (vue-dnd2) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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