Skip to content

Commit

Permalink
修复路由 HTML5 模式下点击导航刷新页面的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
hooray committed Dec 26, 2023
1 parent e1cff24 commit bbd314e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/layouts/components/Menu/item.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ defineExpose({
active: isItemActive,
}"
>
<router-link v-slot="{ href }" custom :to="uniqueKey.at(-1) ?? ''">
<router-link v-slot="{ href, navigate }" custom :to="uniqueKey.at(-1) ?? ''">
<component
:is="subMenu ? 'div' : 'a'" v-bind="{
...(!subMenu && {
Expand All @@ -54,7 +54,11 @@ defineExpose({
}" class="group menu-item-container h-full w-full flex cursor-pointer items-center justify-between gap-1 px-5 py-4 text-[var(--g-sub-sidebar-menu-color)] transition-all hover:(bg-[var(--g-sub-sidebar-menu-hover-bg)] text-[var(--g-sub-sidebar-menu-hover-color)])" :class="{
'text-[var(--g-sub-sidebar-menu-active-color)]! bg-[var(--g-sub-sidebar-menu-active-bg)]!': isItemActive,
'px-3!': rootMenu.isMenuPopup && level === 0,
}" :title="typeof item.meta?.title === 'function' ? item.meta?.title() : item.meta?.title"
}" :title="typeof item.meta?.title === 'function' ? item.meta?.title() : item.meta?.title" v-on="{
...(!subMenu && {
click: navigate,
}),
}"
>
<div
class="inline-flex flex-1 items-center justify-center gap-[12px]" :class="{
Expand Down

0 comments on commit bbd314e

Please sign in to comment.