//父组件
async getNotFuning (obj) {
// console.log(obj[0].art_id) 子组件中传递不过来
const res = await NotFuningApi({ artId: obj })
console.log(res)
}
//子组件
//绑定点击事件获取到的id可以
methods: {
getArtId (index) {
this.artID = index
console.log(this.artID)
},
}
if (action.name === '不感兴趣') {
// 反馈不感兴趣
// 子传父,传文章id
this.$emit('getAriId', this.artID)
console.log(this.artID)
// console.log(this.objArr.art_id) 直接传递不过去为undefined
}
将有问题的完整代码贴出来