Skip to content

Commit 7ab1910

Browse files
committed
[移除购物车]补充food非空校验
1 parent 49f6c3b commit 7ab1910

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/store/mutations.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ export default {
9797
let shop = cart[shopid] = (cart[shopid] || {});
9898
let category = shop[category_id] = (shop[category_id] || {});
9999
let item = category[item_id] = (category[item_id] || {});
100-
if (item) {
100+
if (item && item[food_id]) {
101101
if (item[food_id]['num'] > 0) {
102102
item[food_id]['num']--;
103103
state.cartList = {...cart};

0 commit comments

Comments
 (0)