0👍
I think the issue might come from using this function on created()
:
created() {
window.addEventListener('beforeunload', this.rouFunc() );
},
what you could do is to call this.rouFunc()
directly on created()
, because the window.addEventListener
won’t be triggered, as created()
is done synchronously after the instance is created (see the lifecycle hooks for Vue2 here).
- [Vuejs]-Await api call responding after unmounting of component | vue.js
- [Vuejs]-How to make a validation and show message if default value is selected in dropdown in vue
Source:stackexchange.com