Fix:3993 【商城小程序】在多规格商品入口图点击购物车按钮,会保留上一个商品的选择数量
This commit is contained in:
@@ -130,12 +130,23 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
'attr.cartAttr': {
|
||||||
|
handler(val) {
|
||||||
|
console.log(val);
|
||||||
|
if(!val) {
|
||||||
|
this.cartNumber = 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
deep: true,
|
||||||
|
immediate: true
|
||||||
|
},
|
||||||
cartNum: {
|
cartNum: {
|
||||||
handler(val) {
|
handler(val) {
|
||||||
console.log(val, 'cardNum');
|
console.log(val, 'cardNum');
|
||||||
this.cartNumber = val || 1
|
this.cartNumber = val || 1
|
||||||
},
|
},
|
||||||
deep: true
|
deep: true,
|
||||||
|
immediate: true
|
||||||
},
|
},
|
||||||
cartNumber(val) {
|
cartNumber(val) {
|
||||||
if (val > this.attrObj.productSelect.stock) {
|
if (val > this.attrObj.productSelect.stock) {
|
||||||
|
|||||||
Reference in New Issue
Block a user