diff --git a/docs/custom-formkit-input/README.md b/docs/custom-formkit-input/README.md
index 60631d871..e4455119a 100644
--- a/docs/custom-formkit-input/README.md
+++ b/docs/custom-formkit-input/README.md
@@ -12,6 +12,7 @@
- 参数
1. language: 目前支持 `yaml`, `html`, `css`, `javascript`, `json`
2. height: 编辑器高度,如:`100px`
+- `attachment`: 附件选择
- `menuCheckbox`:选择一组菜单
- `menuRadio`:选择一个菜单
- `menuItemSelect`:选择菜单项
diff --git a/src/formkit/formkit.config.ts b/src/formkit/formkit.config.ts
index 2c0fc28e4..78de33b8c 100644
--- a/src/formkit/formkit.config.ts
+++ b/src/formkit/formkit.config.ts
@@ -4,6 +4,7 @@ import { createAutoAnimatePlugin } from "@formkit/addons";
import { zh } from "@formkit/i18n";
import type { DefaultConfigOptions } from "@formkit/vue";
import { form } from "./inputs/form";
+import { attachment } from "./inputs/attachment";
import { code } from "./inputs/code";
import { menuCheckbox } from "./inputs/menu-checkbox";
import { menuRadio } from "./inputs/menu-radio";
@@ -22,6 +23,7 @@ const config: DefaultConfigOptions = {
plugins: [createAutoAnimatePlugin()],
inputs: {
form,
+ attachment,
code,
menuCheckbox,
menuRadio,
diff --git a/src/formkit/inputs/attachment/AttachmentInput.vue b/src/formkit/inputs/attachment/AttachmentInput.vue
new file mode 100644
index 000000000..53acbecad
--- /dev/null
+++ b/src/formkit/inputs/attachment/AttachmentInput.vue
@@ -0,0 +1,61 @@
+
+
+
+
+
+
+
+
+
diff --git a/src/formkit/inputs/attachment/index.ts b/src/formkit/inputs/attachment/index.ts
new file mode 100644
index 000000000..bdc7253ed
--- /dev/null
+++ b/src/formkit/inputs/attachment/index.ts
@@ -0,0 +1,10 @@
+import { initialValue } from "@formkit/inputs";
+import { createInput } from "@formkit/vue";
+import AttachmentInput from "./AttachmentInput.vue";
+
+export const attachment = createInput(AttachmentInput, {
+ type: "input",
+ props: [],
+ forceTypeProp: "text",
+ features: [initialValue],
+});
diff --git a/src/modules/contents/attachments/components/AttachmentGroupList.vue b/src/modules/contents/attachments/components/AttachmentGroupList.vue
index 7cd2136ca..7b98b332b 100644
--- a/src/modules/contents/attachments/components/AttachmentGroupList.vue
+++ b/src/modules/contents/attachments/components/AttachmentGroupList.vue
@@ -98,6 +98,7 @@ onMounted(async () => {
{
{
diff --git a/src/modules/contents/posts/categories/components/CategoryEditingModal.vue b/src/modules/contents/posts/categories/components/CategoryEditingModal.vue
index 8f7e08ae7..6450340e3 100644
--- a/src/modules/contents/posts/categories/components/CategoryEditingModal.vue
+++ b/src/modules/contents/posts/categories/components/CategoryEditingModal.vue
@@ -152,7 +152,8 @@ watch(
help="需要主题适配以支持"
name="cover"
label="封面图"
- type="text"
+ type="attachment"
+ validation="required"
>
{
v-model="formState.post.spec.cover"
name="cover"
label="封面图"
- type="text"
+ type="attachment"
>
diff --git a/src/modules/contents/posts/tags/components/TagEditingModal.vue b/src/modules/contents/posts/tags/components/TagEditingModal.vue
index 8c83f1167..68c4a7e27 100644
--- a/src/modules/contents/posts/tags/components/TagEditingModal.vue
+++ b/src/modules/contents/posts/tags/components/TagEditingModal.vue
@@ -171,7 +171,7 @@ watch(
name="cover"
help="需要主题适配以支持"
label="封面图"
- type="text"
+ type="attachment"
>
diff --git a/src/modules/system/users/components/UserEditingModal.vue b/src/modules/system/users/components/UserEditingModal.vue
index 2f0fdc175..fe0c6e3d7 100644
--- a/src/modules/system/users/components/UserEditingModal.vue
+++ b/src/modules/system/users/components/UserEditingModal.vue
@@ -197,7 +197,7 @@ const handleRawModeChange = () => {