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 },
本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。