0👍
The this.emitMethod()
statement should be inside the body of .then(...)
and yours is outside.
It is also a good practice to use a beforeDestroy()
hook in navbar.vue
to remove the event handler or otherwise you will have multiple instances of the handler on multiple component mountings (which is quite often during the development).
- [Vuejs]-'Blocked by CORS policy', but Header is present
- [Vuejs]-Vue data value not updating for in function use
Source:stackexchange.com