Utilizing the stepper component, I have implemented a dynamic approach by looping through an array of objects instead of hardcoding the headers and content.
The stepper items are functioning perfectly with:
<v-stepper-items>
<v-stepper-content
v-for="(step, stepIndex) in steps"
:key="stepIndex"
:step="stepIndex"
>
<component :is="step.content"/>
</v-stepper-content>
</v-stepper-items>
However, handling the headers is proving to be challenging. I want to insert a divider component between the headers without wrapping them in a container, as this causes CSS issues. Additionally, the last header should not have a divider.
<v-stepper-header>
<v-container v-for="(step, stepIndex) in steps" :key="stepIndex">
<v-stepper-step :complete="currentStep > stepIndex" :step="stepIndex">
{{step.header}}
</v-stepper-step>
<v-divider :v-if="stepIndex < steps.length - 1"></v-divider>
</v-container>
</v-stepper-header>
I am seeking a solution on how to loop through these stepper headers without affecting the CSS layout.
Update
A demo showcasing the CSS issue can be found below. The use of the v-container
is causing problems.