|
|
|
@ -6,6 +6,8 @@ import { computed, onBeforeUnmount, onMounted, reactive, useSlots } from 'vue'; |
|
|
|
import { useNamespace } from '@vben-core/composables'; |
|
|
|
import { VbenIcon, VbenTooltip } from '@vben-core/shadcn-ui'; |
|
|
|
|
|
|
|
import qs from 'qs'; |
|
|
|
|
|
|
|
import { MenuBadge } from '../components'; |
|
|
|
import { useMenu, useMenuContext, useSubMenuContext } from '../hooks'; |
|
|
|
|
|
|
|
@ -54,6 +56,7 @@ const item: MenuItemRegistered = reactive({ |
|
|
|
active, |
|
|
|
parentPaths: parentPaths.value, |
|
|
|
path: props.path || '', |
|
|
|
query: props.query, |
|
|
|
}); |
|
|
|
|
|
|
|
/** |
|
|
|
@ -81,6 +84,13 @@ onBeforeUnmount(() => { |
|
|
|
}); |
|
|
|
</script> |
|
|
|
<template> |
|
|
|
<a |
|
|
|
:href=" |
|
|
|
(item.parentPaths.at(-1) ?? '') + |
|
|
|
(item?.query ? `?${qs.stringify(item?.query)}` : '') |
|
|
|
" |
|
|
|
@click.prevent.stop="handleClick" |
|
|
|
> |
|
|
|
<li |
|
|
|
:class="[ |
|
|
|
rootMenu.theme, |
|
|
|
@ -90,8 +100,8 @@ onBeforeUnmount(() => { |
|
|
|
is('collapse-show-title', collapseShowTitle), |
|
|
|
]" |
|
|
|
role="menuitem" |
|
|
|
@click.stop="handleClick" |
|
|
|
> |
|
|
|
<!-- --> |
|
|
|
<VbenTooltip |
|
|
|
v-if="showTooltip" |
|
|
|
:content-class="[rootMenu.theme]" |
|
|
|
@ -119,4 +129,5 @@ onBeforeUnmount(() => { |
|
|
|
<slot name="title"></slot> |
|
|
|
</div> |
|
|
|
</li> |
|
|
|
</a> |
|
|
|
</template> |
|
|
|
|