From 0ad8699d8768aa8e982b4a22a67997ef08eb1e07 Mon Sep 17 00:00:00 2001 From: ONLY-yours <1349021570@qq.com> Date: Sun, 29 Oct 2023 12:22:35 +0800 Subject: [PATCH] :pencil2: fix: action types fixed --- src/ActionGroup/demos/config.tsx | 1 + src/ActionGroup/index.tsx | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/ActionGroup/demos/config.tsx b/src/ActionGroup/demos/config.tsx index 68eeec84..575c067c 100644 --- a/src/ActionGroup/demos/config.tsx +++ b/src/ActionGroup/demos/config.tsx @@ -16,6 +16,7 @@ export default () => { items={[ { icon: , + placement: 'bottom', onClick: () => { messageApi.info('复制!'); }, diff --git a/src/ActionGroup/index.tsx b/src/ActionGroup/index.tsx index 44dc6901..d728f578 100644 --- a/src/ActionGroup/index.tsx +++ b/src/ActionGroup/index.tsx @@ -5,11 +5,11 @@ import { RedoOutlined, UndoOutlined, } from '@ant-design/icons'; -import { ActionIcon, getPrefixCls } from '@ant-design/pro-editor'; +import { ActionIcon, ActionIconProps, getPrefixCls } from '@ant-design/pro-editor'; import { Divider, Dropdown, DropdownProps } from 'antd'; import { useStyle } from './style'; -export type ActionIconGroupItemType = { +export type ActionIconGroupItemType = ActionIconProps & { /** * @description 展示的 icon */ @@ -155,7 +155,9 @@ const ActionGroup = (props: ActionGroupProps) => { size={size} {...item} onClick={() => { - item?.onClick(); + if (item?.onClick) { + item?.onClick(); + } onClick(item?.key); }} />