index.js 336 B

12345678910111213141516171819202122
  1. import Vue from 'vue'
  2. import Vuex from 'vuex'
  3. Vue.use(Vuex)
  4. //实例store对象
  5. const store = new Vuex.Store({
  6. state: {
  7. access_token:"",
  8. rongyu:null
  9. },
  10. mutations: {
  11. setToken(state,token){
  12. state.access_token=token;
  13. },
  14. initRongyun(state,rongyu){
  15. state.Rongyu=rongyu;
  16. }
  17. }
  18. })
  19. //导出store对象
  20. export default store