SHARE
TWEET

Untitled

a guest Oct 21st, 2019 82 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. export const state = () => ({
  2.   burgerMenu: false,
  3.   loginModal: false,
  4.   theme: 'default'
  5. })
  6.  
  7. export const mutations = {
  8.   SET_BURGER_MENU (state, data) {
  9.     state.burgerMenu = data
  10.   },
  11.  
  12.   SET_LOGIN_MODAL (state) {
  13.     state.loginModal = !state.loginModal
  14.   },
  15.  
  16.   SET_THEME (state, data) {
  17.     console.log(data)
  18.     state.theme = data
  19.   }
  20. }
  21.  
  22. export const actions = {
  23.   async getTheme ({ commit }) {
  24.     const { data } = await this.$axios.$get('/config')
  25.     commit('SET_THEME', data[0].theme)
  26.   }
  27. }
  28.  
  29. // run dispatch getTheme
  30. this.$store.dispatch('getTheme')
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top