| | |
| | | |
| | | <script> |
| | | import { constantRoutes } from "@/router"; |
| | | import { isHttp } from "@/utils/validate"; |
| | | |
| | | // 隐藏侧边栏路由 |
| | | const hideList = ['/index', '/user/profile']; |
| | |
| | | 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; |
| | | } |
| | | } |
| | |
| | | }, |
| | | // 菜单选择事件 |
| | | 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):// 路径新窗口打开 |
| | | window.open(key, "_blank"); |
| | | } else if (!route || !route.children) { |
| | |
| | | } else { |
| | | this.$store.dispatch('app/toggleSideBarHide', true); |
| | | } |
| | | }, |
| | | ishttp(url) { |
| | | return url.indexOf('http://') !== -1 || url.indexOf('https://') !== -1 |
| | | } |
| | | }, |
| | | }; |