From 50f21cf6db8379da4097a060317aafc81643b63b Mon Sep 17 00:00:00 2001 From: zq <136432190602163.com> Date: Thu, 17 Jul 2025 14:46:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BE=A7=E8=BE=B9=E5=88=87=E6=8D=A2=E5=AD=98?= =?UTF-8?q?=E5=82=A8=E5=BD=93=E5=89=8D=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/SliderScond.vue | 2 ++ src/router/index.js | 5 +++++ src/store/index.js | 9 +++++++++ 3 files changed, 16 insertions(+) diff --git a/src/components/SliderScond.vue b/src/components/SliderScond.vue index 073e4ac..64e55a4 100644 --- a/src/components/SliderScond.vue +++ b/src/components/SliderScond.vue @@ -81,6 +81,7 @@ export default { let subtitle = this.renderKeyNew.subtitle; this.activeFloor = newVal[this.curIndex]?.list?.[0][subtitle]; this.componentsName = newVal[this.curIndex]?.list?.[0]?.componentsName || ''; + store.commit('SET_CURRENTMENUITEM', newVal[this.curIndex]?.list?.[0]); } }, mounted() { @@ -183,6 +184,7 @@ export default { // }, 1000) // } setActiveCur(item1, item, index) { + store.commit('SET_CURRENTMENUITEM', item1); this.curIndex = index; let subtitle = this.renderKeyNew.subtitle; let domName = this.renderKeyNew.domName; diff --git a/src/router/index.js b/src/router/index.js index c79e389..8d37b8c 100755 --- a/src/router/index.js +++ b/src/router/index.js @@ -564,6 +564,11 @@ router.beforeEach((to, from, next) => { next(); }); router.afterEach(() => { + // 清除存储的currentMenuItem + if(!store.state.showSecondSide && store.state.currentMenuItem){ + store.commit('SET_CURRENTMENUITEM',null); + } + // 添加延迟确保过渡效果 setTimeout(() => { store.dispatch('hideLoading') diff --git a/src/store/index.js b/src/store/index.js index 865b513..15bc947 100755 --- a/src/store/index.js +++ b/src/store/index.js @@ -18,6 +18,7 @@ export default new Vuex.Store({ isLoading: false, //页面loading customize: false, //页面loading componentsName:'', + currentMenuItem:null, slidermenu:[], rankMenuData: [{ index: '1', @@ -558,8 +559,16 @@ export default new Vuex.Store({ }) { commit('SET_COMPONENTS_NAME') }, + SET_CURRENTMENUITEM({ + commit + }) { + commit('SET_CURRENTMENUITEM') + }, }, mutations: { + SET_CURRENTMENUITEM(state,data){ + state.currentMenuItem = JSON.parse(JSON.stringify(data)); + }, SET_COMPONENTS_NAME(state,name){ state.componentsName = name; }, -- 1.8.3.1