index.js 438 B

1234567891011121314151617181920212223242526
  1. import Vue from 'vue'
  2. import Vuex from 'vuex'
  3. Vue.use(Vuex) // vue的插件机制
  4. // Vuex.Store 构造器选项
  5. const store = new Vuex.Store({
  6. // 为了不和页面或组件的data中的造成混淆,state中的变量前面建议加上$符号
  7. state: {
  8. // 用户信息
  9. $userInfo: {
  10. id: ''
  11. }
  12. },
  13. mutations: {
  14. },
  15. actions: {
  16. },
  17. getters:{
  18. }
  19. })
  20. export default store