I'm working on a small project using Django and VueJs. Everything is good, I'd just like to know how I can send data from my component (Modal) to another one after making an Axios request? This is my code:
NB: Please read my code comments to understand what I want to do.
Child : AddContact.vue
methods: {
post(){
getAPI.post('api/contact/post/', this.form).then((response) => {
// here I want to send response data to Contact.vue
}).catch((error) => {
})
}
}
Parent : Contact.vue ( where I want to receive data )
<template>
<addContactModal></addContactModal>
</template>
<script>
import addContactModal from "../modals/contact/addContact.vue";
import { getAPI } from '../../../vue/src/axios-api';
export default {
name: 'Contact',
components: {
addContactModal: addContactModal
}
};
</script>