Compare commits
10 Commits
v1.1.0
..
b7191c09bb
| Author | SHA1 | Date | |
|---|---|---|---|
| b7191c09bb | |||
| 60e74b5383 | |||
| e252b9065b | |||
| bc851414b4 | |||
| e7639fef72 | |||
| a8c0809363 | |||
| fdbb51754d | |||
| f0c3d9c173 | |||
| 14d85e5265 | |||
| c8c3c88d99 |
@@ -669,7 +669,7 @@ src/pages/StorageCleaner/useStorageCleaner.ts — 页面级 Hook
|
||||
|
||||
### 9.1 功能元数据
|
||||
|
||||
功能名称与描述在 `config/featureMeta.ts` 的 `FEATURES` 数组中定义:
|
||||
功能名称与描述在 `config/features.tsx` 的 `FEATURES` 数组中定义:
|
||||
|
||||
```typescript
|
||||
{
|
||||
@@ -677,11 +677,10 @@ 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,7 +1505,9 @@ 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 }
|
||||
|
||||
+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