index.js
1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import Vue from 'vue';
import Vuex from 'vuex';
import { createApi } from 'create-api';
import reportError from 'report-error';
import storeYoho from './yoho';
import storeOrder from './order';
import storeList from './list';
import storeProduct from './product';
import storeHome from './home';
import storeAddress from './address';
import storeNotice from './notice';
import storeCategory from './category';
import storeActivitys from './activitys';
Vue.use(Vuex);
export function createStore(context) {
const store = new Vuex.Store({
namespaced: true,
modules: {
yoho: storeYoho(),
order: storeOrder(),
list: storeList(),
product: storeProduct(),
home: storeHome(),
address: storeAddress(),
// 买家订单列表
notice: storeNotice(),
category: storeCategory(),
// buyerOderList: buyerOderList(),
activitys: storeActivitys(),
},
strict: process.env.NODE_ENV !== 'production',
});
const api = createApi(context, store);
store.$api = api;
store.$context = context;
store.$reportError = reportError(context);
return store;
}