mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-ui.git
synced 2025-12-19 09:25:53 +08:00
commit message
This commit is contained in:
1
buyer/src/vuex/actions.js
Normal file
1
buyer/src/vuex/actions.js
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
0
buyer/src/vuex/getters.js
Normal file
0
buyer/src/vuex/getters.js
Normal file
11
buyer/src/vuex/mutations.js
Normal file
11
buyer/src/vuex/mutations.js
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
// 全部商品分类
|
||||
export const SET_CATEGORY = (state, data) => {
|
||||
state.category = data
|
||||
}
|
||||
export const SET_NAVLIST = (state, data) => {
|
||||
state.navList = data
|
||||
}
|
||||
export const SET_CARTNUM = (state, data) => {
|
||||
state.cartNum = data
|
||||
}
|
||||
19
buyer/src/vuex/store.js
Normal file
19
buyer/src/vuex/store.js
Normal file
@@ -0,0 +1,19 @@
|
||||
import Vue from 'vue';
|
||||
import Vuex from 'vuex';
|
||||
import * as actions from './actions';
|
||||
import * as mutations from './mutations';
|
||||
import * as getters from './getters';
|
||||
import storage from '@/plugins/storage.js'
|
||||
|
||||
Vue.use(Vuex);
|
||||
|
||||
export default new Vuex.Store({
|
||||
state: {
|
||||
category: [], // 全部分类
|
||||
navList: [],
|
||||
cartNum: storage.getItem('cartNum') || 0
|
||||
},
|
||||
getters,
|
||||
actions,
|
||||
mutations
|
||||
});
|
||||
Reference in New Issue
Block a user