I'm passing the value of object as props into my "data" studentId inside the form
data() {
return {
form: new Form({
studentId: []
})
};
},
In my method, the classlists has initial value, which are the id of students
insertScore() {
let students = this.classlists; //<---this is my props
let element = [];
let s = [];
for (let index = 0; index < students.length; index++) {
element = students[index].id;
}
}
//id: 7
//id:29
//id:30
What i need is to make my classlists ids to be an array and store it into my studentId like studentId = [7,29,30] , but what i'm getting when i console.log is separate Ids
