From 24f8d0c47a6a183d3b20bb8a82c2bcc69ecdb856 Mon Sep 17 00:00:00 2001 From: YUJT Date: Thu, 14 Apr 2022 15:29:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E6=A0=87=E7=AD=BE=E9=A1=B5=E6=89=93?= =?UTF-8?q?=E5=BC=80=E5=A4=96=E9=83=A8=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/index.js | 9 ++++++++- src/views/main-sidebar-sub-menu.vue | 7 ++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/router/index.js b/src/router/index.js index e5011253..2a276506 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -109,8 +109,15 @@ function fnAddDynamicMenuRoutes (menuList = [], routes = []) { // eslint-disable-next-line let URL = (menuList[i].url || '').replace(/{{([^}}]+)?}}/g, (s1, s2) => eval(s2)) // URL支持{{ window.xxx }}占位符变量 if (isURL(URL)) { - route['path'] = route['name'] = `i-${menuList[i].id}` + if (menuList[i].menuCode.indexOf('newTab-') === 0) { + // 新建标签页打开链接 + route['path'] = menuList[i].url + route['name'] = `i-${menuList[i].id}` + } else { + route['path'] = route['name'] = `i-${menuList[i].id}` + } route['meta']['iframeURL'] = URL + } else { URL = URL.replace(/^\//, '').replace(/_/g, '-') route['path'] = route['name'] = URL.replace(/\//g, '-') diff --git a/src/views/main-sidebar-sub-menu.vue b/src/views/main-sidebar-sub-menu.vue index 292f1c40..5ed9d852 100644 --- a/src/views/main-sidebar-sub-menu.vue +++ b/src/views/main-sidebar-sub-menu.vue @@ -16,6 +16,7 @@