mirror of
https://gitlab.com/PronounsPage/PronounsPage.git
synced 2025-09-11 16:48:32 -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">
|
<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 = [
|
const COLOURS = [
|
||||||
'#C71585',
|
'#C71585',
|
||||||
@ -60,6 +60,7 @@ const drawChart = async () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let colourIndex = 0;
|
let colourIndex = 0;
|
||||||
|
const { default: Chart } = await import('chart.js/auto');
|
||||||
new Chart(canvas.value, {
|
new Chart(canvas.value, {
|
||||||
type: props.type,
|
type: props.type,
|
||||||
data: {
|
data: {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user