diff --git a/docs/superpowers/specs/2026-06-02-data-dashboard-frontend-design.md b/docs/superpowers/specs/2026-06-02-data-dashboard-frontend-design.md index ed92e9f..e5b5377 100644 --- a/docs/superpowers/specs/2026-06-02-data-dashboard-frontend-design.md +++ b/docs/superpowers/specs/2026-06-02-data-dashboard-frontend-design.md @@ -18,6 +18,13 @@ - 加载/空/错误三态 - mock 数据接入 +**6 组件 ↔ 7 接口映射**: +- CrystalOverview → 1 个接口(today-overview) +- IncomeCurve → 1 个接口(income-curve) +- ExhibitionCenter → 1 个接口(exhibition-summary) +- LikeIncomeBoard → 1 个接口(like-income-by-level) +- CollectionMatrix(容器)→ **3 个接口**(top-assets、level-distribution、upgrade-progress),子组件各消费其一 + **Out of scope(不在本文档)**: - 后端 dashboardService 实现(详见配套文档第 4 节) - Figma 素材下载(项目自有 `static/components/` 已含同类资源) @@ -145,7 +152,7 @@ const { - 单 section 失败 → 该 section `data` 保持 `null`、`error` 有值、UI 显示重试 - `refresh('curve')`:只重拉 curve 一个 section - `refresh({ force: true })`:绕过 `lastFetched` 缓存 -- `onUnmounted` 自动清空所有 state(依赖 Vue 3 组件卸载生命周期) +- **资源释放**:composable 内部用 `effectScope` 包裹请求与状态;dashboard.vue 在 `onUnmounted` 中调用 composable 暴露的 `dispose()` 释放 effectScope,确保 `setTimeout`/Promise 回调不污染已卸载组件 ### 4.3 子组件 Props 契约