-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Menu components with web router refresh the whole page #536
Comments
I'm unable to replicate, can you please also provide your menumodel? |
Sure, I pass menu items from setup() method like this:
and then use it in my template like this:
There is nothing else in my template or component. Router is setup in a standard way. Issue went away when I manually removed @click="onItemClick($event, item)" from in MenubarSub, probably because it did not call preventDefault in this case? |
@cagataycivici I created repository that reproduces this bug. It's the simplest example I can think of with just two routes, this menubar and every time you click on it it refreshes whole page: I wasn't able to make primevue work in codesandbox. If you have it setup there it would be nice to share it so we can easily fork it and use it next time. |
I'll check, thank you. |
Resolved it for all menu components. |
this behaviour is still present to this day. |
I use Menubar component as my top level navigation bar but even when I use to property on my menu items clicking any of them still causes whole page to refresh.
I think the problem is that you are using @click event on like this:
After removing this @click handler it started to work properly. This happens on Vue 3 with vue-router version 4.0.0-beta.13.
The text was updated successfully, but these errors were encountered: