perf(加载): 排名、看板、班级 PK、智能分析第一次打开少下两百多 KB

这几页的 Markdown 只在点开抽屉 / 弹层、或 AI 报告出来时才用得上,
却连着整套代码高亮(CodeMirror 和三种语言的解析器)一起静态打进了页面。
改成用到才加载:排名 356→133KB、看板 380→157KB、PK 311→88KB、
智能分析 308→86KB(gzip 后)。

网站图标原来塞了 16 到 256 像素九张图共 192KB,只留标签页用得上的
16 到 48 像素四张(原图像素不变),17KB。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
xuyueandClaude Opus 5.5 committed 2026-10-16 13:48:35 +08:00
1 parent a814776fb9
commit 3bb74171c3
6 files changed
+15 -5

No files matched your search

+3 -1
View File
@@ -2,11 +2,13 @@
import type { LearningPeriod } from "@oj2/contract"
import { Icon } from "@iconify/vue"
import { useThemeVars } from "naive-ui"
import Markdown from "shared/components/Markdown.vue"
import { parseTime } from "utils/functions"
import { streamAI } from "utils/stream"
import { getLatestAnalysis } from "../../api"
// Markdown 连着整套代码高亮(两百多 KB),这里要等点开 / AI 写完才用得上,别让它拖慢页面
const Markdown = defineAsyncComponent(() => import("shared/components/Markdown.vue"))
/**
* AI 小结。进来先拿这个时间段上次生成的那份(老师钉住的优先),没有才出按钮 ——
* 一份小结要等十几秒、也要花钱,不在进页面时自动生成。