parent
							
								
									0a2bb32537
								
							
						
					
					
						commit
						80cceddce2
					
				
				 7 changed files with 108 additions and 37 deletions
			
			
		@ -1,5 +1,18 @@ | 
				
			|||||||
const getters = { | 
					const getters = { | 
				
			||||||
  routes: state => state.menu.routes | 
					  routes: state => state.menu.routes, | 
				
			||||||
 | 
					  screenWidth: state => state.screen.screenWidth, | 
				
			||||||
 | 
					  screenPadding: state => { | 
				
			||||||
 | 
					    let width = state.screen.screenWidth | 
				
			||||||
 | 
					    if (width >= 600) { | 
				
			||||||
 | 
					      if (width >= 1000) { | 
				
			||||||
 | 
					        return {paddingLeft: '15%', paddingRight: '15%'} | 
				
			||||||
 | 
					      } else { | 
				
			||||||
 | 
					        return {paddingLeft: '5%', paddingRight: '5%'} | 
				
			||||||
 | 
					      } | 
				
			||||||
 | 
					    } else { | 
				
			||||||
 | 
					      return {} | 
				
			||||||
 | 
					    } | 
				
			||||||
 | 
					  } | 
				
			||||||
} | 
					} | 
				
			||||||
 | 
					
 | 
				
			||||||
export default getters | 
					export default getters | 
				
			||||||
 | 
				
			|||||||
@ -0,0 +1,19 @@ | 
				
			|||||||
 | 
					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 | 
				
			||||||
 | 
					} | 
				
			||||||
					Loading…
					
					
				
		Reference in new issue