I have scroll event listeners in one of the components that I am using on particular Page. The problem is this event listeners is triggered even after I navigate out of this page (where I am using this component). How to fix it? I got console full of errors.
created () {
if (process.browser) {
window.addEventListener('scroll', this.parallax)
}
},
destroyed () {
if (process.browser) {
window.removeEventListener('scroll', this.parallax)
}
}
<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This question is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c1945">#c1945</a>)</em></sub></div>