I have a multi-step form that each step has a different header structure.
The only variation in the header among the steps is the wording, which changes as you progress through the steps.
I am looking for a way to achieve this using Vue Router:
path: '/form',
name: 'Form',
component: Form,
children: [
{
path: 'step1',
component: FormStep1,
propsForParent: {
title: "myTitle In Header In Form Component"
},
},
{
path: 'step2',
component: FormStep2,
propsForParent: {
title: "myTitle is different In Header In Form Component"
},
}
]
So, when navigating to form/step1, I want the form component to receive the designated title props set in my child configuration above, and so forth for other steps.
I aim to avoid dealing with this logic in the parent component or having the child components communicate with the parent via events or Vuex. I'm seeking a more elegant solution within Vue Router itself.
Any suggestions?