mirror of
https://gitlab.com/PronounsPage/PronounsPage.git
synced 2025-09-08 15:00:37 -04:00
(refactor) load chart.js dynamically on demand
This commit is contained in:
parent
e69eff7104
commit
8d17028dc2
@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import Chart, { type ChartDataset, type ChartOptions, type ChartType } from 'chart.js/auto';
|
||||
import type { ChartDataset, ChartOptions, ChartType } from 'chart.js';
|
||||
|
||||
const COLOURS = [
|
||||
'#C71585',
|
||||
@ -60,6 +60,7 @@ const drawChart = async () => {
|
||||
}
|
||||
|
||||
let colourIndex = 0;
|
||||
const { default: Chart } = await import('chart.js/auto');
|
||||
new Chart(canvas.value, {
|
||||
type: props.type,
|
||||
data: {
|
||||
|
Loading…
x
Reference in New Issue
Block a user