![](https://i-blog.csdnimg.cn/blog_migrate/8f900a89c6347c561fdf2122f13be562.gif)
![](https://i-blog.csdnimg.cn/blog_migrate/961ddebeb323a10fe0623af514929fc1.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 },
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