Fix:3993 【商城小程序】在多规格商品入口图点击购物车按钮,会保留上一个商品的选择数量

This commit is contained in:
LinCyJang
2025-07-08 23:26:16 +08:00
parent 4ebce61781
commit f7816f0d0c
+12 -1
View File
@@ -130,12 +130,23 @@ export default {
}
},
watch: {
'attr.cartAttr': {
handler(val) {
console.log(val);
if(!val) {
this.cartNumber = 1
}
},
deep: true,
immediate: true
},
cartNum: {
handler(val) {
console.log(val, 'cardNum');
this.cartNumber = val || 1
},
deep: true
deep: true,
immediate: true
},
cartNumber(val) {
if (val > this.attrObj.productSelect.stock) {