It appears that I have encountered a bug in my code. My intention is to retrieve components objects by index (for the tag), but I am facing an unusual issue. Details of the problem can be seen below:
Successful scenario:
let steps = ['Handler', 'Categories', 'Finalize'];
export default {
components: {
Handler,
Categories,
Finalize
},
data() {
return {
step: 0,
currentStep: steps[0] // Accessing component using direct index
}
},
}
Error scenario:
let steps = ['Handler', 'Categories', 'Finalize'];
export default {
components: {
Handler,
Categories,
Finalize
},
data() {
return {
step: 0,
currentStep: steps[this.step] // Accessing component using a variable as index
}
},
}
In the successful example, I successfully retrieved the component, however, in the error scenario, Vue DevTools displays currentStep: undefined
. Strangely, there are no console errors present. What could be going wrong?