Compare commits
4 Commits
b7191c09bb
...
v1.0.9
| Author | SHA1 | Date | |
|---|---|---|---|
| 06c2a222ab | |||
| 1af3b25af8 | |||
| 550f8f82c7 | |||
| 36b6bfd20d |
@@ -669,7 +669,7 @@ src/pages/StorageCleaner/useStorageCleaner.ts — 页面级 Hook
|
||||
|
||||
### 9.1 功能元数据
|
||||
|
||||
功能名称与描述在 `config/features.tsx` 的 `FEATURES` 数组中定义:
|
||||
功能名称与描述在 `config/featureMeta.ts` 的 `FEATURES` 数组中定义:
|
||||
|
||||
```typescript
|
||||
{
|
||||
@@ -677,10 +677,11 @@ src/pages/StorageCleaner/useStorageCleaner.ts — 页面级 Hook
|
||||
label: '时间戳转换',
|
||||
description: '日期与时间戳互转',
|
||||
defaultVisible: true,
|
||||
component: TimestampPage,
|
||||
}
|
||||
```
|
||||
|
||||
页面组件通过 `config/pageLoaders/` 按需加载,不在 `FEATURES` 中引用。
|
||||
|
||||
Dashboard 卡片、TopBar 搜索等功能从此处读取 `label` / `description`。
|
||||
|
||||
### 9.2 页面与组件文案
|
||||
|
||||
@@ -383,7 +383,7 @@ function loadRule(ruleId: string): void {
|
||||
使用 `localStorage`,键名 `testDataGenerator_rules`。API 为**命名导出函数**(见 `src/utils/ruleStorage.ts`):
|
||||
|
||||
| 函数 | 说明 |
|
||||
| ---- | ---- |
|
||||
| ------------------------------------------------------ | ---------------------------------- |
|
||||
| `getAll()` / `getById()` / `getByName()` | 读取 |
|
||||
| `save()` / `update()` / `deleteRule()` / `duplicate()` | 写入;失败时返回 `null` 或 `false` |
|
||||
| `recordUse()` | 递增 `useCount`、更新 `lastUsedAt` |
|
||||
|
||||
@@ -1505,9 +1505,7 @@ export class DataExporter {
|
||||
```typescript
|
||||
// src/types/testDataGenerator.ts
|
||||
|
||||
type WorkerRequestMessage =
|
||||
| { type: 'start'; payload: WorkerStartPayload }
|
||||
| { type: 'cancel' };
|
||||
type WorkerRequestMessage = { type: 'start'; payload: WorkerStartPayload } | { type: 'cancel' };
|
||||
|
||||
type WorkerResponseMessage =
|
||||
| { type: 'progress'; generationId: number; payload: GenerateProgress }
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
## 组件列表
|
||||
|
||||
| 组件 | 用途 |
|
||||
| ----------------------- | ------------------------------------------------------------------------------ |
|
||||
| ----------------------- | ------------------------------------------------------------------------------------------------------ |
|
||||
| `RouterContainer.tsx` | 路由容器,根据当前路由动态渲染对应页面组件,集成错误边界和骨架屏 |
|
||||
| `SwitchButtonGroup.tsx` | 通用切换按钮组,支持 `small/medium/large` 三种尺寸,用于页面子模式切换 |
|
||||
| `EmptyPlaceholder.tsx` | 虚线边框空状态占位,统一工具页「暂无结果」提示样式 |
|
||||
|
||||
+1
-1
@@ -43,7 +43,7 @@
|
||||
写入经内部 `setAll()` 完成;`localStorage.setItem` 抛错(如配额超限)时返回 `false`,并 `console.error`,**不会部分提交**:
|
||||
|
||||
| 方法 | 写入失败返回值 | 常见失败原因 |
|
||||
| ---- | -------------- | ------------ |
|
||||
| -------------- | ---------------------------- | ------------------------------------------------------ |
|
||||
| `save()` | `null` | 达上限、规则不存在(更新时)、`setItem` 异常 |
|
||||
| `update()` | `null` | 规则不存在、`setItem` 异常 |
|
||||
| `deleteRule()` | `false` | 规则不存在、`setItem` 异常 |
|
||||
|
||||
Reference in New Issue
Block a user