bencodezen / vue-enterprise-boilerplate

An ever-evolving, very opinionated architecture and dev environment for new Vue SPA projects using Vue CLI.
7.77k stars 1.32k forks source link

Problems with Vue router push #199

Closed Vahagn-Zaqaryan closed 4 years ago

Vahagn-Zaqaryan commented 4 years ago

Thanks

Hi everyone,

First of all, I wanna say thanks, to every member of this boilerplate it's just awesome. Some of the patterns and features are useful and sometimes can save hours of development time.

Now the problem 😢

Recently I was trying to build a basic Vue app and I used this boilerplate as a reference. When I was building the routing part I've noticed an error in my console after debugging I found out that the issue was appearing when I was trying to logout.

This is what I've done differently Instead of using Vue <router-link/> component as done in this boilerplate, I used this.$router.push(...)

As show here image

And this is the error image

Steps to reproduce

  1. In vue-enterprise-boilerplate's nav bar add a button
  2. Create a method logout as shown above
  3. Add click event on the button
  4. Login using mock API credentials
  5. Click newly created logout button

What is expected?

Navigating to logout then redirection to save route without errors.

andreiTn commented 4 years ago

You might want to check this https://github.com/vuejs/vue-router/issues/2881#issuecomment-520554378

Vahagn-Zaqaryan commented 4 years ago

@andreiTn you're right. I didn't get any errors. Thank you so much for the reference! It seems like that this is just putting tape on the problem, but when I explored the solution in detail, everything got in their places.