1.8 版本
This commit is contained in:
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