ES6语法的数组查询

setProductId(param){
console.log(param);
let prod = this.products.find(item =>{
return item.prodCode == param
})
console.log(prod.prodId);
this.form.productId = prod.prodId
} // 数据
products: [
{prodName: '二X分期', prodCode: '0000001', prodId: '43bd8dfa5699400780aae0a4a6095aae'},
{prodName: '验收专用', prodCode: '0000008', prodId: 'eb50229225824aa89562ffd6a5d0feb9'},
],

详细可参考:https://blog.csdn.net/frank_fong/article/details/79654197

上一篇:Loadrunner常用的分析要点都有哪些


下一篇:git push时错误提示的解决办法 By default, updating the current branch in a non-bare repository error: is denied,