import defaultSettings from '@/settings' import variables from '@/styles/element-variables.scss' const { showSettings, tagsView, fixedHeader, sidebarLogo, headBackgroundColorValue, menuIsHorizontal, leftBackgroundColorValue, animationType, isDot } = defaultSettings const state = { animationType: animationType, // 动画类型 leftBackgroundColorValue: leftBackgroundColorValue, // 左边背景颜色 headBackgroundColorValue: headBackgroundColorValue, // 头部背景颜色 menuIsHorizontal: menuIsHorizontal, // 菜单是否是横屏 isDot: isDot, theme: variables.theme, showSettings: showSettings, fixedHeader: fixedHeader, sidebarLogo: sidebarLogo, tagsView: tagsView // 新增tagsView } const mutations = { CHANGE_SETTING: (state, { key, value }) => { // eslint-disable-next-line no-prototype-builtins if (state.hasOwnProperty(key)) { state[key] = value } } } const actions = { changeSetting({ commit }, data) { commit('CHANGE_SETTING', data) } } export default { namespaced: true, state, mutations, actions }