const state = () => ({ isPc: true, screen: 'pc', static: `${process.env.STATIC_URL}/pc`, loginVisiable: false, }) const mutations = { SET_SCREEN(state, width) { if (width > 768) { state.isPc = true state.screen = 'pc' } else { state.isPc = false state.screen = 'h5' } state.static = `${process.env.STATIC_URL}/${state.screen}` }, SHOW_LOGIN(state) { state.loginVisiable = true }, HIDE_LOGIN(state) { state.loginVisiable = false }, } const actions = {} export default { namespaced: true, state, mutations, actions, }