Answer the question
In order to leave comments, you need to log in
How to remove Event Listener in custom directive?
The directive in inserted has this
function myFunc () { console.log('RESIZE!!!') }
window.addEventListener('resize', myFunc)
Answer the question
In order to leave comments, you need to log in
A mixin is more suitable here, rather than a directive. In it, you can register your reaction to mounted and beforeDestroy
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question