I am currently working on a vue Modal component where I have defined a prop containing an array. My intention is to pass this array to another component when the modal is open. However, I am encountering an issue where the prop appears to be undefined when accessed inside my modal component. Even though the prop is recognized in my code, it becomes undefined at a later stage. Can someone please review my code and provide assistance?
script:
<script>
import axios from "axios";
export default {
name: "AddGroupsModal",
data : ()=>({
model : [],
}),
props:{
newGroup: []
},
methods: {
generateGroup(){
const newMeeting = {meetingUrl: "", meetingName: "", date: this.selectedDate,
startTime: "", endTime: ""};
let finalMeetingArray = [];
this.model.forEach((model, i) => {
const key = `participant${i + 1}`;
newMeeting[key] = model.voterUniqueName;
newMeeting.startTime = model.startTime;
newMeeting.endTime = model.endTime
})
finalMeetingArray.push(newMeeting)
this.newGroup.push(newMeeting)
console.log(JSON.stringify(this.newGroup)
}
}
}
</script>