I have created Vue routes with a parent route for 'dashboard' and a child route for 'report', set up like this:
{
path: '/dashboard', component: dashboard,
children: [
{
path:'report', component: report
}
]
},
In the parent component, I have card menus to navigate to the child component along with a router-view:
<template>
<div class="container mt-5">
<div class="row mt-0 h-100">
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-12 my-auto" id="report-card">
<router-link to="/dashboard/report" class="card2">
<div class="d-flex flex-column justify-content-center">
<div class="card-icon p-3">
<img :src="icons[0]"/>
</div>
<h3>Make a Report</h3>
<p class="small">Make a report of a crime or suspicious activities</p>
</div>
</router-link>
</div>
</div>
<router-view></router-view>
</div>
</template>
Clicking on the router link currently renders the child component within the parent view. I'm looking for a solution where the child route replaces the parent entirely, rather than rendering within it. Is there a way to achieve this?