// 公共
const module = {
    // 开启命名空间
    namespaced: true,

    // 仓库
    state: {
        iphoneX:false,
    },

    // 同步方法
    mutations: {
        // 更新数据
        update(state, data) {
            for (let key in data) {
                if (data.hasOwnProperty(key)) {
                    state[key] = data[key]
                }
            }
        },

        // 移除数据
        remove(state, name) {
            if (typeof name === 'string') {
                delete state[name]
            } else {
                for (let key in name) {
                    if (name.hasOwnProperty(key)) {
                        delete state[name[key]]
                    }
                }
            }
        },

        // 移除所有数据
        removeAll(state) {
            for (let key in state) {
                if (state.hasOwnProperty(key)) {
                    delete state[key]
                }
            }
        },
    },

    // 异步方法
    actions: {},
}

export default module
