From 1ed6d6161d01e918172c5268c6834794b1fb4f78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=85=88=E6=9E=97?= Date: Thu, 21 Dec 2023 20:10:34 +0800 Subject: [PATCH] =?UTF-8?q?chore:(amis)=20=E7=BB=99input-image=20=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E6=B7=BB=E5=8A=A0select=E5=8A=A8=E4=BD=9C=EF=BC=8C?= =?UTF-8?q?=E5=85=B6=E4=BB=96=E7=BB=84=E4=BB=B6=E5=8F=AF=E4=BB=A5=E8=A7=A6?= =?UTF-8?q?=E5=8F=91=E4=BB=96=E7=9A=84=E9=80=89=E6=8B=A9=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/zh-CN/components/form/input-image.md | 7 ++++--- packages/amis/src/renderers/Form/InputImage.tsx | 5 +++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/docs/zh-CN/components/form/input-image.md b/docs/zh-CN/components/form/input-image.md index a31cfb06880..8b10331a88b 100755 --- a/docs/zh-CN/components/form/input-image.md +++ b/docs/zh-CN/components/form/input-image.md @@ -730,6 +730,7 @@ app.listen(8080, function () {}); 当前组件对外暴露以下特性动作,其他组件可以通过指定`actionType: 动作名称`、`componentId: 该组件id`来触发这些动作,详细请查看[事件动作](../../docs/concepts/event-action#触发其他组件的动作)。 -| 动作名称 | 动作配置 | 说明 | -| -------- | -------- | ---- | -| clear | - | 清空 | +| 动作名称 | 动作配置 | 说明 | +|--------| -------- |--------| +| clear | - | 清空 | +| select | - | 打开选择图片 | diff --git a/packages/amis/src/renderers/Form/InputImage.tsx b/packages/amis/src/renderers/Form/InputImage.tsx index afaa5aa3c76..95a6e238990 100644 --- a/packages/amis/src/renderers/Form/InputImage.tsx +++ b/packages/amis/src/renderers/Form/InputImage.tsx @@ -1501,6 +1501,11 @@ export default class ImageControl extends React.Component< this.files = []; onChange(''); } + + // @ts-ignore + if (action.actionType === 'select') { + this.handleSelect(); + } } // 重新上传