question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Vue MenuItem router-link causes full reload

See original GitHub issue
<MenuItem>
  <router-link
    :to="{ name: 'Logout' }"
    class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 cursor-pointer focus:outline-none"
    role="menuitem"
  >
    Sign out
  </router-link>
</MenuItem>

any idea why this router link causes a full reload?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:4
  • Comments:6

github_iconTop GitHub Comments

4reactions
RobinMalfaitcommented, Mar 5, 2021

Hey! Thank you for your bug report! Much appreciated! 🙏

The router-link doesn’t forward everything correctly, flipping things around like this might help you: https://codesandbox.io/s/headlessuivue-menu-example-forked-31t3b?file=/src/components/Menu.vue

3reactions
CalebKestercommented, Apr 17, 2021

@RobinMalfait Thanks for fix. It would be good to have this in the docs or try and contact the vue team to “fix” router-link if it really isn’t working correctly as you say. Considering router-links are 1st class plugins for vue I’m guessing most of your vue user base will be running into this issue.

Do you take PRs for the documentation site? I’d be happy to help out as I’m really enjoying headlessui and tailwindui.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Vue.js 3, vue-router, @click event reloads whole page
Im new to Vue and i want while on mobile navigation when I click menuItem I run function toggleMenu(open/close Menu), but then whole...
Read more >
MENU : Click on a link => How to reload only the content part ...
My links are defined in each "url" attribute of the menuItems. I juste want the "content" part to be reloaded, not the entire...
Read more >
RouterLinkActive - Angular
Tracks whether the linked route of an element is currently active, and allows you to specify one or more CSS classes to add...
Read more >
Layout Side Links - Quasar Framework
QSideLink is basically a wrapper over Vue's <router-link> component (read about it here), ... so it acts as a menu item on a...
Read more >
How To Navigate Between Views with Vue Router
To complete this tutorial, you will need: Node.js version 10.6.0 or greater installed on your computer. To install this on macOS or Ubuntu...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found