title: Calling the vue method from inside an event from VueDraggable
body: <p>I am trying to get drag and drop function working in the vue.js app using vue-draggable <a href="https://vuejsexamples.com/vuejs-drag-and-drop-library-without-any-dependency/" rel="nofollow noreferrer">https://vuejsexamples.com/vuejs-drag-and-drop-library-without-any-dependency/</a>
  The library has few events you can listen to and I would like to execute some logic once the item is dropped. However, I am not able to access vue component 'this' along with the data and methods. I've tried to use <code>this.$dispatch('symDragged', event);</code> but it is not working for the same reason. 'this' is not a vue instance but rather instance of draggable element. </p>
  
  <p>Here is the code:</p>
  
  <pre><code>export default {
  components: {
    ICol,
    SymptomsChooser, MultiSelectEditor, TempPressureChooser, BodyPartsEditor, MandatorySymptomsChooser},
  
  data() {
    return {
      // data ommited...
      options: {
        dropzoneSelector: 'ul',
        draggableSelector: 'li',
        excludeOlderBrowsers: true,
        showDropzoneAreas: true,
        multipleDropzonesItemsDraggingEnabled: true,
        onDrop(event) {
          // delete symptom from old basket and add it to new one
          let oldBasket = event.owner.accessKey;
          let newBasket = event.droptarget.accessKey;
  
          //this is not working
          //this.symDragged(this.draggedSymId, oldBasket, newBasket);
        },
        onDragstart(event) {
          this.draggedSymId = event.items[0].accessKey;
        }
      }
    }
  },
  methods: {
    symDragged(symId, oldBasketId, newBasketId) {
      console.log("symDragged!");
  
      let draggedSym = this.getSymById(symId);
  
      let basketOld = this.getBasketById(oldBasketId);
      this.delSym(basketOld, draggedSym);
      this.addSym({baskedId: newBaskedId, sym: draggedSym});
  
    }
    //other methods ommited
  }
  </code></pre>
  
  <p>} </p>
  
  <p>So, what is the correct way to call the vue component method from callback event? Or maybe I need to create another event so that vue instance could listen to it? </p>
  
  <p>Thanks for you help!</p>