You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
1.2 KiB
52 lines
1.2 KiB
import type from '../type'
|
|
|
|
export default {
|
|
state: {
|
|
clientHeight: document.documentElement.clientHeight,
|
|
size: 'medium',
|
|
resolution: 'medium',
|
|
env: 'dev',
|
|
userType: 'oper'
|
|
},
|
|
getters: {
|
|
clientHeight: (state) => state.clientHeight,
|
|
size: (state) => state.size,
|
|
resolution: (state) => state.resolution,
|
|
env: (state) => state.env,
|
|
userType: (state) => state.userType
|
|
},
|
|
mutations: {
|
|
[type.client_height](state, payload) {
|
|
state.clientHeight = payload
|
|
},
|
|
[type.size](state, payload) {
|
|
state.size = payload
|
|
},
|
|
[type.resolution](state, payload) {
|
|
state.resolution = payload
|
|
},
|
|
[type.env](state, payload) {
|
|
state.env = payload
|
|
},
|
|
[type.user_type](state, payload) {
|
|
state.userType = payload
|
|
}
|
|
},
|
|
actions: {
|
|
setClientHeight({ commit }, payload) {
|
|
commit(type.client_height, payload)
|
|
},
|
|
setSize({ commit }, payload) {
|
|
commit(type.size, payload)
|
|
},
|
|
setResolution({ commit }, payload) {
|
|
commit(type.resolution, payload)
|
|
},
|
|
setEnv({ commit }, payload) {
|
|
commit(type.env, payload)
|
|
},
|
|
setUserType({ commit }, payload) {
|
|
commit(type.user_type, payload)
|
|
}
|
|
}
|
|
}
|
|
|