This commit is contained in:
2020-07-16 17:39:06 +08:00
parent 91241682de
commit b250d05adf
14 changed files with 497 additions and 72 deletions

View File

@@ -4,16 +4,20 @@ Vue.use(Vuex)
const store = new Vuex.Store({
state: {
count: 0
cartInfo: {}, // 购物车数据
orderAddress: {}, // 下单时选择的地址
},
getters: {
doubleCount (state) {
return state.count * 2
getOrderAddress(state) {
return state.orderAddress;
}
},
mutations: {
increment (state) {
state.count++
updateCart(state, cart) {
state.cartInfo = cart;
},
updateAddress(state, address) {
state.orderAddress = address;
}
}
})