0👍
Actually in Vue, you should use built-in event handling:
https://v2.vuejs.org/v2/guide/events.html
Also, if you need animation on route change, consider using <transition></transition>
:
https://v2.vuejs.org/v2/guide/transitions.html
However if you want manually manage event listeners, you can do that via route guards or lifecycle hooks.
- [Vuejs]-SyntaxError: Unexpected token import while using Nuxt 2.0 build.transpile
- [Vuejs]-Configure webpack proxy for http requests in VueJs + Axios
Source:stackexchange.com