[Vuejs]-Vue js invalid router after login

0👍

The problem was in <a> tags, don’t know why, but kill vue routing, so I changed this:

<router-link v-if="is_logged" tag="li" :to="{ name: 'Statistics' }">
  <a>Statistics</a>
</router-link>

to this:

<li v-if="is_logged"><router-link tag="a" :to="{ name: 'Statistics' }">
  Statistics
</router-link></li>

0👍

This will happen If your route definition uses async loading import(...), and you named the chunks the same. Check the comment that declares the names in your routes.

Also, make sure your Statistics route really does return the correct component. Did you cut-and-paste?

Leave a comment