diff --git a/src/router/router.config.js b/src/router/router.config.js index 7d991e9..94a251b 100644 --- a/src/router/router.config.js +++ b/src/router/router.config.js @@ -19,7 +19,7 @@ export const constantRouterMap = [ path: '/assistance', name:'assistance', component: () => import('@/views/assistance'), - meta: { title: '诉求代办', keepAlive: false } + meta: { title: '诉求代办', keepAlive: true } }, { path: '/changePassword', diff --git a/src/store/index.js b/src/store/index.js index 056992a..c621c2e 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -1,20 +1,3 @@ -// import Vue from 'vue' -// import Vuex from 'vuex' -// import getters from './getters' -// import app from './modules/app' - -// Vue.use(Vuex) - -// const store = new Vuex.Store({ - -// modules: { -// app -// }, -// getters -// }) - -// export default store - import Vue from 'vue' import Vuex from 'vuex' diff --git a/src/store/modules/app.js b/src/store/modules/app.js index 7f81758..3b415cd 100644 --- a/src/store/modules/app.js +++ b/src/store/modules/app.js @@ -1,15 +1,29 @@ const state = { - userName: '' + userName: '', + tabActive:0, + scrollTop:0 } const mutations = { SET_USER_NAME(state, name) { state.userName = name - } + }, + SET_TAB_ACTIVE(state, num) { + state.tabActive = num + }, + SET_SCROLL_TOP(state, num){ + state.scrollTop = num + }, } const actions = { // 设置name setUserName({ commit }, name) { commit('SET_USER_NAME', name) + }, + setTabActive({ commit }, num) { + commit('SET_TAB_ACTIVE', num) + }, + setScrollTop({ commit }, num){ + commit('SET_SCROLL_TOP', num) } } export default { diff --git a/src/views/assistance/index.vue b/src/views/assistance/index.vue index b00ac6a..d483f65 100644 --- a/src/views/assistance/index.vue +++ b/src/views/assistance/index.vue @@ -1,5 +1,5 @@