docs: 数据看板 spec 补充 effectScope 与 6/7 映射说明
应用 spec reviewer 的两条建议:澄清 composable 用 effectScope 释放 资源(非依赖 onUnmounted),并显式说明 6 组件消费 7 接口的映射 (CollectionMatrix 内部消费 3 个)。 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
parent
1b1f9b22fe
commit
e3f28a82c9
@ -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 契约
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user