Skip to content

Menu components with web router refresh the whole page #536

Closed
@LadislavBohm

Description

@LadislavBohm

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:

<router-link v-if="item.to && !item.disabled" :to="item.to" :class="getLinkClass(item)" v-ripple
                    @click="onItemClick($event, item)" @keydown="onItemKeyDown($event, item)" role="menuitem">
                    <span :class="['p-menuitem-icon', item.icon]"></span>
                    <span class="p-menuitem-text">{{item.label}}</span>
</router-link>

After removing this @click handler it started to work properly. This happens on Vue 3 with vue-router version 4.0.0-beta.13.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type: BugIssue contains a bug related to a specific component. Something about the component is not working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions