From e2fb3602f17e5d5b70ef83238ac73a38ac7a3cf3 Mon Sep 17 00:00:00 2001 From: lmx <2538381255@qq.com> Date: Thu, 19 Mar 2026 23:56:13 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=8F=9C=E5=8D=95?= =?UTF-8?q?=E9=A1=B9=E5=A4=96=E9=83=A8=E9=93=BE=E6=8E=A5=E8=B7=B3=E8=BD=AC?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 引入 isHttpUrl 工具函数用于判断 URL 类型 - 添加 isHttp 计算属性检测父路径是否为 HTTP 链接 - 修改菜单项渲染逻辑,对外部链接直接使用原地址跳转 - 调整 HTML 结构,将链接属性移到正确位置 - 确保内部路由和外部链接都能正常工作 --- .../menu-ui/src/components/menu-item.vue | 78 ++++++++++--------- 1 file changed, 40 insertions(+), 38 deletions(-) diff --git a/packages/@core/ui-kit/menu-ui/src/components/menu-item.vue b/packages/@core/ui-kit/menu-ui/src/components/menu-item.vue index 5b72cea24..e9236aaf4 100644 --- a/packages/@core/ui-kit/menu-ui/src/components/menu-item.vue +++ b/packages/@core/ui-kit/menu-ui/src/components/menu-item.vue @@ -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,45 +95,44 @@ onBeforeUnmount(() => { (item?.query ? `?${qs.stringify(item?.query)}` : '') " > - -
  • + - - - - - -
    - - - - -
    -
  • + + + +
    + + + + +