I'd like to make my Vue 3 app, using Vue Router 4, to follow a pattern with nested children. This is my list of routes:
export default VueRouter.createRouter({
history: VueRouter.createWebHashHistory(),
routes: [
{
name: 'booking-start',
path: '/',
component: BookingStep1Component,
children: [
{
name: 'booking-step-1',
path: '/:from_gid/:to_gid',
component: BookingStep1Component,
children: [
{
name: 'booking-step-2',
path: ':date_from/:date_to',
component: BookingStep2Component,
children: [
{
name: 'booking-step-3',
path: ':time_from/:time_to',
component: BookingStep3Component
},
]
}
]
}
]
}
]
})
So if I go the the url /# I would like to get the BookingStep1Component displayed, same goes with /#123/456. If I go to /#123/456/2022-01-01/2022-02-28, I'd like to see BookingStep2Component, and if I go to /#123/456/2022-01-01/2022-02-28/10:00/13:00, I'd like to see BookingStep3Component. But things get mixed up somewhere and I do not see the right component at some stage.
Is there anything obvious I am missing here?