A
A
Alexander2017-08-14 08:22:55
Vue.js
Alexander, 2017-08-14 08:22:55

Do I need to remove event handlers from an element assigned by a custom directive in vue.js?

I want to write a custom directive to install some event handlers. And I don't understand how to pass data between different directive life cycle hooks. Somehow I don't want to use Dataset at all. Accordingly, I don’t understand how and where I can save the identifiers of the handlers, so that later I can delete these handlers before unbinding the directive from the element. And is it necessary to remove these handlers at all? Will they go away on their own? In fact, I just need to hang up 2 handlers that cause user events and that's it.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question