vue-router:按名称和参数导航到嵌套状态/路由



如何使用$router.push导航到子状态?

我的路线:

const routes = [
{
path: "/customers", name: 'Customers',
components: {content: CustomersMain},
props: {header: true, content: false},
children: [
{
path: '',
component: CustomerDetailsEmpty
},
{
path: ':id',
name: 'CustomerDetails',
component: CustomerDetails
}
]
}
];

如何使用id参数集导航到具有CustomerDetails$router.push

这起到了作用:

this.$router.push({ name: `CustomerDetails`, params: {id} });

最新更新