优化首屏

This commit is contained in:
2025-10-05 21:07:29 +08:00
parent 7e6d03ca1a
commit 1ba042fae9
14 changed files with 233 additions and 114 deletions

View File

@@ -1,8 +1,29 @@
<script setup lang="ts">
import { Bar } from "vue-chartjs"
import {
Chart as ChartJS,
CategoryScale,
LinearScale,
BarElement,
Title,
Tooltip,
Legend,
Colors,
} from "chart.js"
import { ChartType } from "utils/constants"
import { Rank } from "utils/types"
// 仅注册柱状图所需的 Chart.js 组件
ChartJS.register(
CategoryScale,
LinearScale,
BarElement,
Title,
Tooltip,
Legend,
Colors,
)
const props = defineProps<{ rankData: Rank[]; type: ChartType }>()
const data = computed(() => {