1.8 版本
This commit is contained in:
@@ -5,6 +5,7 @@ import api from './modules/api'
|
||||
import user from './modules/user'
|
||||
import tagsView from './modules/tagsView'
|
||||
import permission from './modules/permission'
|
||||
import settings from './modules/settings'
|
||||
import getters from './getters'
|
||||
|
||||
Vue.use(Vuex)
|
||||
@@ -15,7 +16,8 @@ const store = new Vuex.Store({
|
||||
api,
|
||||
user,
|
||||
tagsView,
|
||||
permission
|
||||
permission,
|
||||
settings
|
||||
},
|
||||
getters
|
||||
})
|
||||
|
||||
23
src/store/modules/settings.js
Normal file
23
src/store/modules/settings.js
Normal file
@@ -0,0 +1,23 @@
|
||||
import Config from '@/config'
|
||||
|
||||
const settings = {
|
||||
state: {
|
||||
showRightPanel: false,
|
||||
tagsView: Config.tagsView,
|
||||
fixedHeader: Config.fixedHeader,
|
||||
sidebarLogo: Config.sidebarLogo
|
||||
},
|
||||
mutations: {
|
||||
CHANGE_SETTING: (state, { key, value }) => {
|
||||
if (state.hasOwnProperty(key)) {
|
||||
state[key] = value
|
||||
}
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
changeSetting({ commit }, data) {
|
||||
commit('CHANGE_SETTING', data)
|
||||
}
|
||||
}
|
||||
}
|
||||
export default settings
|
||||
@@ -56,7 +56,8 @@ const tagsView = {
|
||||
},
|
||||
|
||||
DEL_ALL_VISITED_VIEWS: state => {
|
||||
state.visitedViews = []
|
||||
const affixTags = state.visitedViews.filter(tag => tag.meta.affix)
|
||||
state.visitedViews = affixTags
|
||||
},
|
||||
DEL_ALL_CACHED_VIEWS: state => {
|
||||
state.cachedViews = []
|
||||
@@ -129,7 +130,6 @@ const tagsView = {
|
||||
resolve([...state.cachedViews])
|
||||
})
|
||||
},
|
||||
|
||||
delAllViews({ dispatch, state }, view) {
|
||||
return new Promise(resolve => {
|
||||
dispatch('delAllVisitedViews', view)
|
||||
|
||||
Reference in New Issue
Block a user