diff --git a/components/ProductWindow.vue b/components/ProductWindow.vue index 0c7d53a..09825f5 100644 --- a/components/ProductWindow.vue +++ b/components/ProductWindow.vue @@ -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) {