vue-dragula icon indicating copy to clipboard operation
vue-dragula copied to clipboard

Destroy is not working (Remove event listeners)

Open Daedra22 opened this issue 3 years ago • 1 comments

Hi, I created the listeners for drop events : Vue.vueDragula.eventBus.$on("drop", function (args) {...

I add the listener when the component is mounted, now I want to remove the listener when its destroyed. How can I remove the listeners. drake.destroy is the original method, I tried the following, but it didnt work: Vue.vueDragula.destroy() or var bag = Vue.vueDragula.find("questions-bag"); bag.drake.destroy();

Daedra22 avatar Mar 06 '22 10:03 Daedra22

The directive will call destroy on unbind. you can remove bus listener with Vue.vueDragula.eventBus.$off("drop", fn)

Astray-git avatar Mar 07 '22 13:03 Astray-git