我需要从FeaturedProducts内部检测父路由/products
.vue组件.其路由路径为/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')
}
]
}];
如何在组件中以编程方式找到父路由?