如何使用$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} });