景徳镇旅游微信小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
546 B

8 months ago
  1. import Vue from 'vue'
  2. import Vuex from 'vuex'
  3. Vue.use(Vuex); //vue的插件机制
  4. import api from '@/api/api.js'
  5. //Vuex.Store 构造器选项
  6. const store = new Vuex.Store({
  7. state: {
  8. configList: [], //配置列表
  9. shop : false
  10. },
  11. getters: {
  12. // 角色 true为水洗店 false为酒店
  13. userShop(state){
  14. return state.shop
  15. }
  16. },
  17. mutations: {
  18. // 初始化配置
  19. initConfig(state){
  20. api('getConfig', res => {
  21. if(res.code == 200){
  22. state.configList = res.result
  23. }
  24. })
  25. },
  26. },
  27. actions: {},
  28. })
  29. export default store