Update charts reactively
mainvue-chartjs automatically watches for changes in the :data and :options props. If you pass new data or options, the wrapper will update or re-render the chart.
Handling Read-only Data:
If you encounter Vue's Target is readonly warning when updating chartData (common when using read-only reactive values), you can bypass this by passing a clone of the data:
<template>
<Bar :data="JSON.stringify(JSON.parse(chartData))" :options="chartOptions" />
</template>Note: Using structuredClone on a read-only computed value will result in a Write operation failed: computed value is readonly error. For best results, use a writable computed value.