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.
37 lines
831 B
37 lines
831 B
|
5 years ago
|
import type from '../type'
|
||
|
|
|
||
|
|
export default {
|
||
|
|
state: {
|
||
|
|
clientHeight: document.documentElement.clientHeight,
|
||
|
|
size: 'medium',
|
||
|
|
resolution: 'medium'
|
||
|
|
},
|
||
|
|
getters: {
|
||
|
|
clientHeight: state => state.clientHeight,
|
||
|
|
size: state => state.size,
|
||
|
|
resolution: state => state.resolution
|
||
|
|
},
|
||
|
|
mutations: {
|
||
|
|
[type.client_height] (state, payload) {
|
||
|
|
state.clientHeight = payload
|
||
|
|
},
|
||
|
|
[type.size] (state, payload) {
|
||
|
|
state.size = payload
|
||
|
|
},
|
||
|
|
[type.resolution] (state, payload) {
|
||
|
|
state.resolution = payload
|
||
|
|
}
|
||
|
|
},
|
||
|
|
actions: {
|
||
|
|
setClientHeight ({ commit }, payload) {
|
||
|
|
commit(type.client_height, payload)
|
||
|
|
},
|
||
|
|
setSize ({ commit }, payload) {
|
||
|
|
commit(type.size, payload)
|
||
|
|
},
|
||
|
|
setResolution ({ commit }, payload) {
|
||
|
|
commit(type.resolution, payload)
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|