1š
I would suggest that when two sibling components need to ācommunicateā, a parent component should āfacilitateā. The report component may emit an event that will inform the parent, then the parent performs an action/sets a property to enable the table component to display.
In your case (laravel) the parent component
is the Vue instance thatās probably defined in resources/js/app.js (this Vue instance that targetsā). I would not advice you to use this global instance for this page-specific functionality, because you probably have more pages. Instead youād better create a new component that will be the parent and call this component in your page/blade.
Some snippets to clarify the possible solution:
@extends('layouts.app')
@section('content')
<div class="container">
<div id="app">
<reporter-app></reporter-app>
</div>
</div>
@endsection
// reporter-app.vue
<template>
<div>
<!-- listen for `success` events from report-meeting -->
<report-meeting @success="displayTable=true"></report-meeting>
<hr>
<!-- only displays when displayTable == true -->
<table-report v-if="displayTable"></table-report>
</div>
....
</template>
// report-meeting.
runReport: function() {
axios.get('api/get_report', this.formReport)
.then((response) => {
...
...
this.$emit('success')
})
}
I hope this clarifies it a bit.