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.
45 lines
1017 B
45 lines
1017 B
|
4 years ago
|
import type from '../type'
|
||
|
|
|
||
|
|
export default {
|
||
|
|
state: {
|
||
|
|
clientHeight: document.documentElement.clientHeight,
|
||
|
|
size: 'medium',
|
||
|
|
resolution: 'medium',
|
||
|
|
env: 'dev'
|
||
|
|
},
|
||
|
|
getters: {
|
||
|
|
clientHeight: (state) => state.clientHeight,
|
||
|
|
size: (state) => state.size,
|
||
|
|
resolution: (state) => state.resolution,
|
||
|
|
env: (state) => state.env
|
||
|
|
},
|
||
|
|
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
|
||
|
|
}
|
||
|
|
},
|
||
|
|
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)
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|