• Jobs
  • About Us
  • professionals
    • Home
    • Jobs
    • Courses and challenges
  • business
    • Home
    • Post vacancy
    • Our process
    • Pricing
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Salary Calculator

0

286
Views
VueJs: how to create data depending on the order of the components

In VueJs, I need to be able to compute a quantity which depends on the order of the components in a table:

<mySlides>
  <componentTableOfContent></componentTableOfContent>
  <componentA my-title="First title" pages="5">Blabla</componentA>
  <componentB my-title="Second title" pages="2">Bleble</componentA>
  <componentC my-title="Third title" pages="4">Blibli</componentA>
<mySlides>

Should produce something as following:

Table of content:
- First title, pages 1-5
- Second title, pages 6-7
- Third title, pages 8-12

# First title, page 1

Blabla

# Second title, page 6

Bleble

# Third title, page 8

Blibli 

Do you know how I could do that?

Note that I don't want to specify in each component its absolute position for the sake of maintainability. Ideally, the method should work irrespective of the time to load each component, and would get updated if some components are dynamically added.

EDIT I'm wondering if list of slots could not help with this task How to render a list of static content with Vue named slot? but if so I'm not yet sure to see how to use them in vue 3

almost 3 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Our process Sales
Legal
Terms and conditions Privacy policy
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recommend me some offers
I have an error