I have a situation where I am sending an event with different values from my ConversationList component (child) to the ConversationModel component (parent).
Conversation List
getConversation(conversation_id, receiver_id, username, avatar){
this.$emit('open-conversation', receiver_id, conversation_id, username, avatar);
}
ConversationModal
Vue devtools output
[2,1,"Jeff","http://i.pravatar.cc/52"]
Template
<converstations-list v-if="showConversation == false" v-on:open-conversation="getConversation($event)"></converstations-list>
Method
getConversation(event){
console.log(event.payload[0] + event.payload[1] + event.payload[2] + event.payload[2])
},
Error
Error in event handler for "open-conversation": "TypeError: Cannot read property '2' of undefined"
I'm having trouble accessing the payload object that is shown in the devtools
after firing the event. What could be causing this issue?