I am facing an issue where I need to identify the parent route /products
while working within the scope of the FeaturedProducts.vue component. The current route path for this component is set as /product-list/featured
const routes = [
{
path: "/",
name: "Home",
component: () => import('./Home.vue')
},
{
path: "/product-list",
name: "Products",
component: () => import('./Products.vue'),
children: [
{
path: '/featured',
name: "FeaturedProducts",
component: import('./FeaturedProducts.vue')
}
]
}];
I am seeking a solution on how to programmatically determine the parent route in a component?