Blame view

src/store/modules/app.js 786 Bytes
1 2 3 4 5
/*
 * @Description: 
 * @Autor: renchao
 * @LastEditTime: 2023-05-17 10:34:44
 */
赵千 committed
6 7 8
import Cookies from 'js-cookie'

const state = {
任超 committed
9
    size: 'small',
任超 committed
10
    theme: '#409EFF',
任超 committed
11
    splitScreen: false,
赵千 committed
12 13 14 15 16 17
}

const mutations = {
    SET_SIZE: (state, size) => {
        state.size = size
        Cookies.set('size', size)
任超 committed
18 19 20 21
    },
    UPDATE_THEME (state, val) {
        state.theme = val;
    },
任超 committed
22 23
    SET_SCREEN (state, val) {
        state.splitScreen = val;
任超 committed
24
    },
赵千 committed
25 26 27 28 29
}

const actions = {
    setSize ({ commit }, size) {
        commit('SET_SIZE', size)
任超 committed
30 31 32
    },
    updateTheme ({ commit }, val) {
        commit('UPDATE_THEME', val)
任超 committed
33 34 35
    },
    settScreen ({ commit }, val) {
        commit('SET_SCREEN', val)
任超 committed
36
    },
赵千 committed
37 38 39 40 41 42 43 44
}

export default {
    namespaced: true,
    state,
    mutations,
    actions
}