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.
46 lines
1.1 KiB
46 lines
1.1 KiB
import type from '../type'
|
|
|
|
export default {
|
|
state: {
|
|
clientHeight: document.documentElement.clientHeight,
|
|
size: 'medium',
|
|
resolution: 'medium',
|
|
env: 'dev',
|
|
iframeHeight:120
|
|
},
|
|
getters: {
|
|
clientHeight: (state) => state.clientHeight,
|
|
size: (state) => state.size,
|
|
resolution: (state) => state.resolution,
|
|
env: (state) => state.env,
|
|
iframeHeight: (state) => state.iframeHeight
|
|
},
|
|
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)
|
|
}
|
|
}
|
|
}
|
|
|