Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

224
Views
cant render multiple charts on v-slider-items inside a v-slider

I'm trying to display multiple charts (from the chart.js library),I want each chart to be in a v-slider-item.

In the beginning I was told my code wasn't working because I was trying to append the chart canvas into the v-slider-item before the DOM element was updated and therefor the v-slider-items weren't rendered, so I executed the chart rendering code inside the this.nextTick()

after doing that the code only renders the first chart inside a v-slider-item and wont render the rest...

heres a link to a codepen that shows the error:not rendering v-slider example

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

As a quick fix you may add eager prop to your <v-carousel-item> component.


A small explanation:

Your problem is because Vuetify is using lazy loading of its components. So when the page is loaded, only the block with the first chart exists in the DOM. In your code you are trying to get link to your component using document.getElementById(chart.chartName). Unfortunately, it is not possible even with $nextTick method - second or third chart will be loaded only when you change carousel active item.

But eager prop allows you to force load all charts at the moment when this page is loaded (to be more precise, at mounted stage). Please, keep in mind that in production this trick may lead to some performance issues.

Maybe it should be better to you to use framework-oriented library like vue-chartjs.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!