1
let orderId = [] for(var i in this.selectedData){ console.log(this.selectedData[i])//打印可看到取到的值 orderId.push(this.selectedData[i].orderId)//取到数组每一个对象中的id,push到数组中 }
2
let orderProductId = []//点击发货的时候传的订单子id数组 this.products.forEach(item => { orderProductId.push(item.orderProductId) })
3
用法1 const that = this let orderProductId = []//点击发货的时候传的订单子id数组 that.products.map(item => { orderProductId.push(item.orderProductId) }) 用法2,直接取到数组products下其他数组/值 this.produceList = res.data.products.map((x,index) => {//明细数组获取 return x.skuDetails })