@change="(value) => selected(value, item)"selected(val, item) { if (val === true) { this.selectedData.push(item.courseware_id) } else { let index = this.selectedData.indexOf(item.courseware_id); if (index > -1) { this.selectedData.splice(index, 1); } } },
//组件//js selected(val) { let data = this.treeList.find(item => { if (item.id === val) { return item } }); console.log(data); }, 重点:根据值查数组相同的元素