ea24440cdecc0c64dd5e8b71bc09ec8704c4ba81.svn-base 588 B

1234567891011121314151617181920212223242526272829303132
  1. import defaultSettings from '@/settings'
  2. const { showSettings, tagsView, fixedHeader, sidebarLogo } = defaultSettings
  3. const state = {
  4. showSettings: showSettings,
  5. tagsView: tagsView,
  6. fixedHeader: fixedHeader,
  7. sidebarLogo: sidebarLogo
  8. }
  9. const mutations = {
  10. CHANGE_SETTING: (state, { key, value }) => {
  11. if (state.hasOwnProperty(key)) {
  12. state[key] = value
  13. }
  14. }
  15. }
  16. const actions = {
  17. changeSetting({ commit }, data) {
  18. commit('CHANGE_SETTING', data)
  19. }
  20. }
  21. export default {
  22. namespaced: true,
  23. state,
  24. mutations,
  25. actions
  26. }