From 48817519a919c7a848215db3a7755b9554206cdc Mon Sep 17 00:00:00 2001 From: 疯狂的狮子li <15040126243@163.com> Date: 星期一, 26 七月 2021 13:08:54 +0800 Subject: [PATCH] update 修改页面文档与源码地址 --- ruoyi-ui/src/components/TopNav/index.vue | 15 +++++++++++++-- 1 files changed, 13 insertions(+), 2 deletions(-) diff --git a/ruoyi-ui/src/components/TopNav/index.vue b/ruoyi-ui/src/components/TopNav/index.vue index c8837f2..edb9c53 100644 --- a/ruoyi-ui/src/components/TopNav/index.vue +++ b/ruoyi-ui/src/components/TopNav/index.vue @@ -87,7 +87,7 @@ // 榛樿婵�娲荤殑鑿滃崟 activeMenu() { const path = this.$route.path; - let activePath = this.routers[0].path; + let activePath = this.defaultRouter(); if (path.lastIndexOf("/") > 0) { const tmpPath = path.substring(1, path.length); activePath = "/" + tmpPath.substring(0, tmpPath.indexOf("/")); @@ -100,7 +100,7 @@ } var routes = this.activeRoutes(activePath); if (routes.length === 0) { - activePath = this.currentIndex || this.routers[0].path + activePath = this.currentIndex || this.defaultRouter() this.activeRoutes(activePath); } return activePath; @@ -121,6 +121,17 @@ const width = document.body.getBoundingClientRect().width / 3; this.visibleNumber = parseInt(width / 85); }, + // 榛樿婵�娲荤殑璺敱 + defaultRouter() { + let router; + Object.keys(this.routers).some((key) => { + if (!this.routers[key].hidden) { + router = this.routers[key].path; + return true; + } + }); + return router; + }, // 鑿滃崟閫夋嫨浜嬩欢 handleSelect(key, keyPath) { this.currentIndex = key; -- Gitblit v1.9.3