Skip to content

Commit 8642b4e

Browse files
authored
Update docs for attachment form type refactor in 2.22 (#534)
1 parent bd87bf7 commit 8642b4e

3 files changed

Lines changed: 39 additions & 1 deletion

File tree

docs/developer-guide/form-schema.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,36 @@ UI 效果:
413413

414414
#### 描述
415415

416+
:::info
417+
在 Halo 2.22 中,我们重构了原有的 attachment 表单类型,支持了预览和直接上传文件,并将旧版的表单类型更名为了 [attachmentInput](#attachmentinput)。
418+
:::
419+
420+
附件类型的输入框,支持预览附件、直接上传文件、从附件库选择。
421+
422+
#### 参数
423+
424+
- `accepts`:文件类型,数据类型为 `string[]`
425+
- `width`:预览区域宽度
426+
- `aspectRatio`:预览区域长宽比,比如 `1/1`、`16/9`
427+
- `multiple`:是否支持多选,设置为 `true` 之后,数据结构为字符串数组
428+
429+
#### 示例
430+
431+
```yaml
432+
- $formkit: attachment
433+
name: logo
434+
label: Logo
435+
accepts:
436+
- "image/png"
437+
- "video/mp4"
438+
- "audio/*"
439+
value: ""
440+
```
441+
442+
### attachmentInput
443+
444+
#### 描述
445+
416446
附件类型的输入框,支持直接调用附件库弹框选择附件。
417447

418448
****#### 参数

docs/developer-guide/plugin/api-changelog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,3 +151,7 @@ Extension.create({
151151
可直接移除 `getDraggable` 扩展点,不再使用,也无需考虑兼容性问题。
152152

153153
关于 `getDraggableMenuItems` 扩展点的详细文档可查阅:[拖拽菜单扩展](./extension-points/ui/default-editor-extension-create.md#5-拖拽菜单扩展)
154+
155+
### 表单定义 > 重构 `attachment` 表单类型
156+
157+
在 Halo 2.22 中,我们重构了原有的 attachment 表单类型,支持了预览和直接上传文件,并将旧版的表单类型更名为了 [attachmentInput](../form-schema.md#attachmentinput)

docs/developer-guide/theme/api-changelog.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,14 @@ description: 记录每一个版本的主题 API 变更记录,方便开发者
99

1010
在 2.22.0 中,我们为 FormKit 表单提供了通用的图标选择器,基于 [Iconify](https://icon-sets.iconify.design/),详细文档可查阅:[表单定义#Iconify](../../developer-guide/form-schema.md#iconify)
1111

12-
### 表单定义 > 新增 `array` 组件
12+
### 表单定义 > 新增 `array` 表单类型
1313

1414
在 2.22.0 中,我们为 FormKit 表单新增了 `array` 组件,用于定义一组数据,并计划使用 `array` 组件替换原有的 `repeater` 组件。详细文档可查阅:[表单定义#array](../../developer-guide/form-schema.md#array)
1515

16+
### 表单定义 > 重构 `attachment` 表单类型
17+
18+
在 Halo 2.22 中,我们重构了原有的 attachment 表单类型,支持了预览和直接上传文件,并将旧版的表单类型更名为了 [attachmentInput](../form-schema.md#attachmentinput)
19+
1620
### 文章 Finder API > 修改 `cursor(postName)` 返回结构
1721

1822
我们修改了文章 Finder API 中 `cursor(postName)` 方法的返回体结构,移除了 `current` 字段,并修改了 `previous``next` 字段类型为 `ListedPostVo`,并明确了上一篇文章是指发布时间较当前文章更早的文章,下一篇文章是指发布时间较当前文章更新的文章。详细文档可查阅:[文章 Finder API#cursor](../../developer-guide/theme/finder-apis/post.md#cursor)

0 commit comments

Comments
 (0)