docs: 内置字段类型照 fields/ 目录重列——删掉不存在的 json,补上 array/object,点明未注册类型是静默回落

This commit is contained in:
2026-08-11 16:57:43 +08:00
parent 00c2211271
commit 4b6f260227
3 changed files with 8 additions and 4 deletions
+5 -1
View File
@@ -191,7 +191,11 @@ Vite dev 默认用 **esbuild** 把 node_modules 里的裸导入预打包成 `nod
| `FieldRelativeTime.vue` | `relativeTime` |
| 你自己的 `FieldMyType.vue` | `myType` |
后端 moduleInfo 里 `field.type === 'myType'` 时就用你这个组件。内置类型: `string` / `boolean` / `date` / `json` / `number` / `password` / `relation` / `select` / `tab` / `textarea` / `relativeTime`。
后端 moduleInfo 里 `field.type === 'myType'` 时就用你这个组件。
内置类型以 `src/components/fields/` 目录为准,当前是: `array` / `boolean` / `date` / `number` / `object` / `password` / `relation` / `relativeTime` / `select` / `string` / `tab` / `textarea`。其中 `relativeTime` 是本实现独有的,shrimp-server 的 `ShrimpFieldTypes` 里没有。
**没有 `json`。** 后端发一个没注册的 type 过来不会报错,`getFieldComponent` 静默回落成 `string` 渲染,只在控制台留一条 warning——列照样出、内容不对。字符串数组要用 `array` + `item`,嵌套对象用 `object` + `fields`。
### 业务模块