[Vuejs]-Change login to logout when login

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).

Leave a comment