Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Destroy is not working (Remove event listeners) #51

Open
Daedra22 opened this issue Mar 6, 2022 · 1 comment
Open

Destroy is not working (Remove event listeners) #51

Daedra22 opened this issue Mar 6, 2022 · 1 comment

Comments

@Daedra22
Copy link

Daedra22 commented Mar 6, 2022

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();

@Astray-git
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants