const state = { screenWidth: document.body.clientWidth } const mutations = { UPDATE_SCREEN_WIDTH(state, value) { state.screenWidth = value console.log('run update screen width') } } const actions = {} export default { namespaced: true, state, mutations, actions }