I'm new to Vue and have been working on a demo project and I can't seem to understand how routes with query parameters work. I noticed in the documentation that they recommend router.push({ path: 'register', query: { plan: 'private' }}) which would produce /register?plan=private.
Is there a way to do this with nested routes?
I'm trying to achieve this as the URL for the BookAppointment component: /physicians/?appt_id=12345&npi=123456789. If there is a better way to do this I'm open to suggestions. Thanks in advance.
router/index.js
const router = new VueRouter({
routes: [
{ path: '/physicians/', component: PhysicianLanding,
children: [
{
// PhysicianProfile
path: 'profile/:url',
component: PhysicianProfile
},
{
// BookAppointment has 3 different progress steps to get to
// the confirm page
path: '',
query: { appt_id: '12345', npi: '123456789'},
component: BookAppointment
}
]
}
]
})