Hello everyone, I'm encountering an issue with my code. In my main component, I have several sub-components structured like this:
<template>
<div id="container">
<div v-if=condition>
Component1
</div>
<div v-if=condition>
Component2
</div>
<div v-if=condition>
Component3
</div>
<div v-if=condition>
Component 4
</div>
</div>
</template>
The use of v-if is to render only one component at a time on the frontend. When the application starts, it displays the first component. As I click on "next", it reveals the next component in line.
Now, I want to include a page indicator by counting the child div tags within the "container". Here are some methods I've attempted:
// returning 0var count = $("#container div").length;
// returning 2var count2 = $("#container").children().length;
These results are incorrect since there should be 4 children div, not 0 or 2. I suspect that the other components aren't being rendered. How can I address this issue?