我正在尝试从孩子向父母发出多个参数。最好的方法是什么。
孩子
getUpdated(value, type) {
if (type === 'students') {
this.students = value.map(val => val.id);
}
if (type === 'programs') {
this.programs = value.map(val => val.code);
}
this.$emit('selectedOptions', students:this.students, programs:this.programs );
},
家长
onSelectedOption(students, programs) {
if (students !== undefined || students.length > 1) {
this.students = students;
}
if (programs !== undefined || programs.length > 1) {
this.programs = programs;
}
},