Is there a way to automatically number components as children of another component? #6986
Unanswered
joulev
asked this question in
Help/Questions
Replies: 1 comment 1 reply
-
I did not get your point clearly. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to make a slideshow in Vue 3. Overall, it is functional with the main file looking like this.
However, I have to pass a
slide
prop to each<Slide>
component, and have to update those numbers manually whenever I need to add a new slide. ConstantmaxSlide
also needs to be updated manually. While "this works", it's not good...Is there any way to somehow update
maxSlide
automatically according to the number of<Slide>
components called, and haveslide
props passed to<Slide>
components automatically without manual effort?For my specific use case, the
<div>
inapp.vue
only has<Slide>
as children (no extra markup before or after these slides inside the same<div>
), although I am interested in how to number only the<Slide>
even with other markup inside the<div>
too.Thank you in advance.
Beta Was this translation helpful? Give feedback.
All reactions