js下拉框:从数组中筛选出匹配的数据
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
1 handleChange(val) { 2 let obj = {} 3 // 遍历数组 4 obj = this.options.find(item => { 5 // 筛选出匹配的数据 6 return item.id === val 7 }) 8 this.hzid = obj.hzid 9 this.projectId = obj.id 10 console.log(obj, this.projectId, this.hzid) 11 },
本文来自博客园,作者:叶子玉,转载请注明原文链接:https://www.cnblogs.com/knuzy/p/10710252.html