js下拉框:从数组中筛选出匹配的数据 随笔 第1张
 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       },
View Code

 

扫码关注我们
微信号:SRE实战
拒绝背锅 运筹帷幄

SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。