app.js 595 B

12345678910111213141516171819202122232425262728293031323334
  1. const state = () => ({
  2. isPc: true,
  3. screen: 'pc',
  4. static: `${process.env.STATIC_URL}/pc`,
  5. loginVisiable: false,
  6. })
  7. const mutations = {
  8. SET_SCREEN(state, width) {
  9. if (width > 768) {
  10. state.isPc = true
  11. state.screen = 'pc'
  12. } else {
  13. state.isPc = false
  14. state.screen = 'h5'
  15. }
  16. state.static = `${process.env.STATIC_URL}/${state.screen}`
  17. },
  18. SHOW_LOGIN(state) {
  19. state.loginVisiable = true
  20. },
  21. HIDE_LOGIN(state) {
  22. state.loginVisiable = false
  23. },
  24. }
  25. const actions = {}
  26. export default {
  27. namespaced: true,
  28. state,
  29. mutations,
  30. actions,
  31. }