vue-chart-3 icon indicating copy to clipboard operation
vue-chart-3 copied to clipboard

v-bind not working well in v-for loop

Open mbokil opened this issue 2 years ago • 2 comments

I ran into this problem with v-bind. I have line charts in a loop using the composition API but the charts kept disappearing when the data changes. I ended up having to force the line charts remount using a v-if hack. After the component is mounted I set the v-if to true to force the component to remount. Anyone seen this issue? <LineChart v-if="row.isVisible" v-bind="row.bpTrendProps" class="tilesLineChart" :options="row.bpChartOptions" />

mbokil avatar Oct 30 '21 14:10 mbokil

Hi @mbokil , can you make a quick reproduction on codesandbox or something so I can investigate? :) Maybe is because of the v-for key attribute, but I think you tried it already

victorgarciaesgi avatar Oct 30 '21 14:10 victorgarciaesgi

Yeah I have a unique key for each element. I tried some other suggestions like adding another binding like :updateCount="count" to the chart and then incremented count after updating the data but the reactivity doesn't pickup the change. Let me see if I can isolate the component and post it with some mock data on codesandbox.

mbokil avatar Oct 30 '21 14:10 mbokil