How to use events with vue-draggable

0

I can not detect events with the library vue-draggable documentation for rearrangements of lists

JS

  Vue.use(VueDraggable);

new Vue({
   el: '#app',
  data: {
    items: [
      {id: 1, title: "Iqssq"},
      {id: 2, title: "Itemaa 2"},
      {id: 3, title: "Itemvvvv 3"}
    ],
      items2: [
      {id: 1, title: "Item 1"},
      {id: 2, title: "Item 2"},
      {id: 3, title: "Item 3"}
    ],
    options: {
    dropzoneSelector: '.lista',
       draggableSelector: '.item',
      // excludeOlderBrowsers: true,
     showDropzoneAreas: true,
      // multipleDropzonesItemsDraggingEnabled: true,
      onDrop(event) {
       alert("sort".event)


     },
     onDragstart(event) {
      //   event.stop();

      },
    onDragend(event) {

     }
    }
  }
});

HTML

<html>
  <head></head>
  <body>
    <div id="app">

 <div v-drag-and-drop:options="options" >
    <ul class="lista">
      <li v-for="item in items"  class="item"> Item 1   {{ item.title}} </li>

    </ul>
    <ul   class="lista">
      <li v-for="item in items2" class="item">Item 2  {{ item.title}}   </li>

    </ul>

  </div>
  </body>
</html>

HERE MY CODE OPEN CODE

    
asked by Jcastillovnz 04.01.2019 в 21:51
source

0 answers