前端新增可配置侧边栏风格,可以配置网页主题色

This commit is contained in:
Devil
2021-06-25 17:24:02 +08:00
parent 7e1348cb41
commit 9f5b59c4b5
15 changed files with 9950 additions and 137 deletions
+3 -1
View File
@@ -5,6 +5,7 @@ import VuexPersistence from 'vuex-persist'
import { user } from '@/store/module/user'
import { router } from '@/store/module/router'
import { dictionary } from '@/store/module/dictionary'
import { app } from '@/store/module/app'
Vue.use(Vuex)
const vuexLocal = new VuexPersistence({
@@ -15,7 +16,8 @@ export const store = new Vuex.Store({
modules: {
user,
router,
dictionary
dictionary,
app
},
plugins: [vuexLocal.plugin]
})
+33
View File
@@ -0,0 +1,33 @@
import variables from '@/style/element_visiable.scss'
export const app = {
namespaced: true,
state: {
theme: variables.colorPrimary,
sideMode: 'dark'
},
mutations: {
CHANGETHEME: (state, value) => {
state.theme = value
},
CHANGESIDEMODE: (state) => {
if (state.sideMode === 'dark') {
state.sideMode = 'light'
} else {
state.sideMode = 'dark'
}
}
},
actions: {
changeTheme({ commit }, data) {
commit('CHANGETHEME', data)
},
changeSideMode({ commit }) {
commit('CHANGESIDEMODE')
}
},
getters: {
getSIdeMode(state) {
return state.sideMode
}
}
}