I'm building a chat app, and in the cat vue component I have:
<template>
<div class="chat-app">
<Conversation :contact="selectedContact" :messages="messages" @new="saveNewMessage"/>
<ContactsList :contacts="contacts" @selected="startConversationWith"/>
</div>
then in the script part, in the methods array, I have:
saveNewMessage(message) {
this.messages.push(message);
},
Basically, there is an attribute in contact that I want to bring into the message to save it in message - the conversation_id. Is there a way to get contact into saveNewMessage()? I tried saveNewMessage(message, contact), but that didn't work. Thanks in advance!