From df78ac03838b36b4618d0cf4a47fcba115c26f09 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=E5=A2=9E=EF=BC=8C=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E5=A4=96=E9=83=A8=E9=93=BE=E6=8E=A5=EF=BC=8C=E6=89=93=E5=BC=80?= =?UTF-8?q?=E6=96=B0=E6=A0=87=E7=AD=BE=E9=A1=B5?= 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 0a2caf33..332e8535 100644 --- a/src/views/main-sidebar-sub-menu.vue +++ b/src/views/main-sidebar-sub-menu.vue @@ -16,6 +16,7 @@