From 3ef2eeb9e079e7f9122bba8077d91f0414298bf9 Mon Sep 17 00:00:00 2001 From: buqiyuan <1743369777@qq.com> Date: Fri, 22 Mar 2024 08:51:12 +0800 Subject: [PATCH] fix(layout): [breadcrumb] incorrect navigation --- src/layout/header/components/breadcrumb/index.vue | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/layout/header/components/breadcrumb/index.vue b/src/layout/header/components/breadcrumb/index.vue index abcccbe39..4aef0b4df 100644 --- a/src/layout/header/components/breadcrumb/index.vue +++ b/src/layout/header/components/breadcrumb/index.vue @@ -13,13 +13,15 @@ // 点击菜单 const clickMenuItem = (menuItem: RouteRecordRaw) => { - if (!menuItem.redirect) return; + const { isExt, extOpenMode, type } = menuItem?.meta || {}; + + if (type === 0 && !menuItem.redirect) return; - const { isExt, extOpenMode } = menuItem?.meta || {}; if (isExt && extOpenMode === 1) { window.open(menuItem.path); } else { - router.push({ name: menuItem.name }); + const to = typeof menuItem.redirect === 'string' ? menuItem.redirect : menuItem; + router.push(to); } };