From 1ed31d1b48f041f3fb95d2e03587123a987d658f Mon Sep 17 00:00:00 2001 From: zq <136432190602163.com> Date: Fri, 1 Aug 2025 14:15:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BE=A7=E8=BE=B9=E6=A0=8F?= =?UTF-8?q?=E9=AB=98=E4=BA=AE=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/SetLeftMenu.vue | 20 +++++++++++++------- src/store/index.js | 8 +++++--- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/src/components/SetLeftMenu.vue b/src/components/SetLeftMenu.vue index 9848efe..0598ce7 100644 --- a/src/components/SetLeftMenu.vue +++ b/src/components/SetLeftMenu.vue @@ -3,12 +3,13 @@ @@ -57,7 +58,7 @@ export default { } }, mounted() { - this.activeFloor = this.menuList[this.curIndex]?.list?.[0]?.desc; + this.activeFloor = this.menuList[this.curIndex]?.list?.[0]?.desc || this.menuList[this.curIndex]?.list?.[0]?.path; this.componentsName = this.menuList[this.curIndex]?.list?.[0]?.componentsName; this.$nextTick(() => { // 更可靠的获取滚动容器方式 @@ -207,9 +208,14 @@ export default { } this.scrollLock = true; - this.activeFloor = item1.desc; + if(item1.desc){ + this.activeFloor = item1.desc; + } // 如果 二级路由存在跳转 那么不再进行页面的滚动 - if(item1.path)return + if(item1.path){ + this.activeFloor = item1.path; + return + } this.$nextTick(() => { this.setHighActive(item1.desc); diff --git a/src/store/index.js b/src/store/index.js index 6c26236..fb19a19 100755 --- a/src/store/index.js +++ b/src/store/index.js @@ -10,7 +10,7 @@ export default new Vuex.Store({ showFooter: false, showHeader: false, menuList: [], //目录菜单 - secondMenu:{}, + secondMenu:{},//第三种侧边栏 -- 可折叠、 切换显示 showBreadcrumb: false, //是否展示面包屑 breadRightText: '', //是否展示面包屑 pageTitle: '一般新文献', //页面标题 @@ -20,6 +20,7 @@ export default new Vuex.Store({ componentsName:'', currentMenuItem:null, slidermenu:[], + // 第二种侧边栏--单项可跳转 rankMenuData: [ { name: '总利润', @@ -98,6 +99,7 @@ export default new Vuex.Store({ ] }, ], + // 第一种侧边栏--可折叠、可跳转 menuData: [ { index: '1', @@ -236,7 +238,7 @@ export default new Vuex.Store({ ] } ], - siteSettingData:[ + siteSettingData:[//第二种侧边栏 -- 点击单项进行页面滚动 { name: '基本设置', path: '/agent/siteBaseSetting', @@ -322,7 +324,7 @@ export default new Vuex.Store({ ] } ], - siteServiceSettingData:[ + siteServiceSettingData:[//第二种侧边栏 -- 单项切换对应组件 { name: '服务设置', path: '',//设置为空