diff --git a/src/renderers/Action.tsx b/src/renderers/Action.tsx index 7d88ad35b9a..cce2c32c27f 100644 --- a/src/renderers/Action.tsx +++ b/src/renderers/Action.tsx @@ -913,25 +913,36 @@ export class ActionRenderer extends React.Component { mergedData = createObject(data, action.args); } - // 触发渲染器事件 - const rendererEvent = await dispatchEvent( - e as React.MouseEvent | string, - mergedData - ); - - // 阻止原有动作执行 - if (rendererEvent?.prevented) { - return; - } - if (!ignoreConfirm && action.confirmText && env.confirm) { let confirmed = await env.confirm(filter(action.confirmText, mergedData)); if (confirmed) { + // 触发渲染器事件 + const rendererEvent = await dispatchEvent( + e as React.MouseEvent | string, + mergedData + ); + + // 阻止原有动作执行 + if (rendererEvent?.prevented) { + return; + } + await onAction(e, action, mergedData); } else if (action.countDown) { throw new Error('cancel'); } } else { + // 触发渲染器事件 + const rendererEvent = await dispatchEvent( + e as React.MouseEvent | string, + mergedData + ); + + // 阻止原有动作执行 + if (rendererEvent?.prevented) { + return; + } + await onAction(e, action, mergedData); } } diff --git a/src/renderers/CRUD.tsx b/src/renderers/CRUD.tsx index 9fddd581113..b891e7ef042 100644 --- a/src/renderers/CRUD.tsx +++ b/src/renderers/CRUD.tsx @@ -2067,6 +2067,7 @@ export default class CRUD extends React.Component { autoGenerateFilter, onSelect, autoFillHeight, + onEvent, ...rest } = this.props;