diff --git a/src/components/inputBox.vue b/src/components/inputBox.vue
index bbb1793..3b33b6b 100644
--- a/src/components/inputBox.vue
+++ b/src/components/inputBox.vue
@@ -98,6 +98,11 @@
// 提交数据
emit('submit', {title: data.title, price: data.price, num: (data.num == -1 ? 1 : data.num), priceTxt: data.price.toFixed(2)}, props.index);
+ // 直接清空
+ good.value.title = '';
+ good.value.price = 0;
+ good.value.num = -1,
+ good.value.priceTxt = '';
}
diff --git a/src/store/cart.ts b/src/store/cart.ts
index 1cdbcd1..36ad5bf 100644
--- a/src/store/cart.ts
+++ b/src/store/cart.ts
@@ -73,7 +73,7 @@ export const useCartStore = defineStore('cart', () => {
}
// 如果存在,则直接加数量,前面加判定防止出现意外值
- if (ind >= 0 && state.datalist[ind]) state.datalist[ind].num += data.num;
+ if (ind >= 0 && state.datalist[ind]) state.datalist[ind].num += data.num;
}
diff --git a/src/views/HomeView.vue b/src/views/HomeView.vue
index 17ce241..286e132 100644
--- a/src/views/HomeView.vue
+++ b/src/views/HomeView.vue
@@ -34,7 +34,7 @@
-