解决发布页,关联商品bug,注释watch

This commit is contained in:
cc_zbp 2023-05-15 11:21:16 +08:00
parent d28d897e65
commit b58bf795f8

View File

@ -139,15 +139,13 @@
watch: {
checkedObj: {
handler(n) {
this.checkedArr = n
console.log('watch', this.checkedArr);
// this.checkedArr = n
},
deep: true
}
},
mounted() {
this.checkedArr = this.checkedObj
console.log('mounted', this.checkedArr);
this.getBounht();
this.getCollect();
this.getBrowse();
@ -288,20 +286,15 @@
/*点击选中与否*/
goodsCheck(item, index) {
this.$set(item, 'check', !item.check);
console.log("Arr", this.checkedArr);
if (item.check) {
this.checkedArr.push(item)
console.log("增加", this.checkedArr)
} else {
console.log("删除前", this.checkedArr);
this.checkedArr.splice(this.checkedArr.findIndex(itemn => ((itemn.spu_id == item.spu_id) || (item.spu_id == (
itemn.spu && itemn.spu.spu_id)))), 1)
console.log("删除后", this.checkedArr);
}
},
/*确定提交*/
submit() {
console.log('提交', this.checkedArr);
this.$emit('getProduct', this.checkedArr);
},
}