Reputation: 13089
How can I navigate to a child state using $router.push
?
My routes:
const routes = [
{
path: "/customers", name: 'Customers',
components: {content: CustomersMain},
props: {header: true, content: false},
children: [
{
path: '',
component: CustomerDetailsEmpty
},
{
path: ':id',
name: 'CustomerDetails',
component: CustomerDetails
}
]
}
];
How can I navigate to CustomerDetails
with an id
param set using
$router.push
?
Upvotes: 7
Views: 5489
Reputation: 13089
This did the trick:
this.$router.push({ name: `CustomerDetails`, params: {id} });
Upvotes: 7