daily pastebin goal
3%
SHARE
TWEET

Untitled

a guest Apr 16th, 2018 44 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import Vue from 'vue'
  2. import Vuex from 'vuex'
  3.  
  4. Vue.use(Vuex)
  5.  
  6. const state = {
  7.   user: null
  8. }
  9.  
  10. const mutations = {
  11.   updateUser (state, { user }) {
  12.     Vue.set(state, 'user', user)
  13.   }
  14. }
  15. const getters = {
  16.   user: state => state.user
  17. }
  18. const actions = {
  19. }
  20.  
  21. const store = new Vuex.Store({
  22.   state,
  23.   mutations,
  24.   actions,
  25.   getters
  26. })
  27.  
  28. export default store
RAW Paste Data
Top