vue elementUI select组件向后端传两个参数( id和name)
在js里methods里写上
selectSubjectItem() { const item = this.teacherShuzu.find(item1 => item1.nickname === this.createCourseForm.teacher_name) this.createCourseForm.teacher_id = item.id this.createCourseForm.teacher_name = item.nickname },
选中名称后两个字段就同时传过去了 完美解决!!