Are listeners removed when directive is destroyed?

Viewed 2274

Here's a simple options object for a directive. When the directive is destroyed what happens to the event listener? Is it stuck in memory or is it removed?

export default {
  inserted (el) {
    el.addEventListener('click', function () {
      console.log('Click!')
    })
  }
}
1 Answers
Related