修改砍价watch监听值

This commit is contained in:
hupeng
2021-05-19 11:30:54 +08:00
parent edb4ae6a21
commit 0b344aa46d

View File

@ -118,6 +118,11 @@ export default {
templateList: [], templateList: [],
form1: { form1: {
good:{ good:{
productId: null,
storeName: null,
image: null,
otPrice: null,
price: null,
} }
}, },
form: { form: {
@ -168,10 +173,10 @@ export default {
} }
}, },
watch: { watch: {
'form.imageArr': function(val) { 'form.image': function(val) {
if (val && Array.isArray(val)) { this.form1.good.image = this.form.image
this.form.image = val.join(',') this.form1.good.productId = this.form.productId
}
}, },
'form.sliderImageArr': function(val) { 'form.sliderImageArr': function(val) {
console.log("aaa:"+val) console.log("aaa:"+val)
@ -179,13 +184,16 @@ export default {
this.form.images = val.join(',') this.form.images = val.join(',')
} }
}, },
'form1.good': { 'form1.good.productId': {
handler(val,oldVal){ handler(val,oldVal){
this.getInfoChooseGood (val.cform.id) if(val){
this.getInfoChooseGood (val)
}
}, },
deep:true//对象内部的属性监听,也叫深度监听 deep:true//对象内部的属性监听,也叫深度监听
}, },
}, },
methods: { methods: {
// 详情选择商品生成规格用 // 详情选择商品生成规格用
getInfoChooseGood (id) { getInfoChooseGood (id) {