|
|
|
@ -5,6 +5,7 @@ import { computed, onBeforeUnmount, onMounted, reactive, useSlots } from 'vue'; |
|
|
|
|
|
|
|
import { useNamespace } from '@vben-core/composables'; |
|
|
|
import { VbenIcon, VbenTooltip } from '@vben-core/shadcn-ui'; |
|
|
|
import { isHttpUrl } from '@vben-core/shared/utils'; |
|
|
|
|
|
|
|
import qs from 'qs'; |
|
|
|
|
|
|
|
@ -33,6 +34,8 @@ const menuIcon = computed(() => |
|
|
|
active.value ? props.activeIcon || props.icon : props.icon, |
|
|
|
); |
|
|
|
|
|
|
|
const isHttp = computed(() => isHttpUrl(item.parentPaths.at(-1))); |
|
|
|
|
|
|
|
const isTopLevelMenuItem = computed( |
|
|
|
() => parentMenu.value?.type.name === 'Menu', |
|
|
|
); |
|
|
|
@ -92,8 +95,8 @@ onBeforeUnmount(() => { |
|
|
|
(item?.query ? `?${qs.stringify(item?.query)}` : '') |
|
|
|
" |
|
|
|
> |
|
|
|
<a :href="href" @click.prevent.stop="handleClick"> |
|
|
|
<li |
|
|
|
<a |
|
|
|
:href="isHttp ? item.parentPaths.at(-1) : href" |
|
|
|
:class="[ |
|
|
|
rootMenu.theme, |
|
|
|
b(), |
|
|
|
@ -102,8 +105,8 @@ onBeforeUnmount(() => { |
|
|
|
is('collapse-show-title', collapseShowTitle), |
|
|
|
]" |
|
|
|
role="menuitem" |
|
|
|
@click.prevent.stop="handleClick" |
|
|
|
> |
|
|
|
<!-- --> |
|
|
|
<VbenTooltip |
|
|
|
v-if="showTooltip" |
|
|
|
:content-class="[rootMenu.theme]" |
|
|
|
@ -130,7 +133,6 @@ onBeforeUnmount(() => { |
|
|
|
<slot></slot> |
|
|
|
<slot name="title"></slot> |
|
|
|
</div> |
|
|
|
</li> |
|
|
|
</a> |
|
|
|
</router-link> |
|
|
|
</template> |
|
|
|
|