From ca0c92a05c8be10ada67ed30aa71e9a3037b3db1 Mon Sep 17 00:00:00 2001 From: zhanghua <314079846@qq.com> Date: 星期四, 21 十一月 2024 21:52:49 +0800 Subject: [PATCH] Merge branch 'master' of http://42.193.1.25:9521/r/project_management-vue --- src/components/TopNav/index.vue | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/components/TopNav/index.vue b/src/components/TopNav/index.vue index f214245..3d5b7b9 100644 --- a/src/components/TopNav/index.vue +++ b/src/components/TopNav/index.vue @@ -33,7 +33,6 @@ <script> import { constantRoutes } from "@/router"; -import { isHttp } from "@/utils/validate"; // 闅愯棌渚ц竟鏍忚矾鐢� const hideList = ['/index', '/user/profile']; @@ -79,7 +78,7 @@ if(router.path === "/") { router.children[item].path = "/" + router.children[item].path; } else { - if(!isHttp(router.children[item].path)) { + if(!this.ishttp(router.children[item].path)) { router.children[item].path = router.path + "/" + router.children[item].path; } } @@ -125,9 +124,10 @@ }, // 鑿滃崟閫夋嫨浜嬩欢 handleSelect(key, keyPath) { + debugger; this.currentIndex = key; const route = this.routers.find(item => item.path === key); - if (isHttp(key)) { + if (this.ishttp(key)) { // http(s):// 璺緞鏂扮獥鍙f墦寮� window.open(key, "_blank"); } else if (!route || !route.children) { @@ -161,6 +161,9 @@ } else { this.$store.dispatch('app/toggleSideBarHide', true); } + }, + ishttp(url) { + return url.indexOf('http://') !== -1 || url.indexOf('https://') !== -1 } }, }; -- Gitblit v1.8.0