fix init.

This commit is contained in:
2023-01-27 11:06:31 +08:00
parent f557135075
commit be6e9eaaef
9 changed files with 105 additions and 39 deletions

View File

@@ -0,0 +1,28 @@
import {
Chart as ChartJS,
Title,
Colors,
Tooltip,
Legend,
BarElement,
ArcElement,
CategoryScale,
LinearScale,
} from "chart.js"
const [isLoaded] = useToggle()
export function loadChart() {
if (isLoaded.value) return
ChartJS.register(
CategoryScale,
LinearScale,
BarElement,
ArcElement,
Colors,
Title,
Tooltip,
Legend
)
isLoaded.value = true
}