diff --git a/packages/amis/src/renderers/Table/TableRow.tsx b/packages/amis/src/renderers/Table/TableRow.tsx index 28a1f6415..6c737c31b 100644 --- a/packages/amis/src/renderers/Table/TableRow.tsx +++ b/packages/amis/src/renderers/Table/TableRow.tsx @@ -132,7 +132,7 @@ export class TableRow extends React.PureComponent< @autobind handleAction(e: React.UIEvent, action: Action, ctx: any) { const {onAction, item} = this.props; - onAction && onAction(e, action, ctx || item.locals); + return onAction && onAction(e, action, ctx || item.locals); } @autobind diff --git a/packages/amis/src/renderers/Table/index.tsx b/packages/amis/src/renderers/Table/index.tsx index d8ef56bd5..b63caa0e9 100644 --- a/packages/amis/src/renderers/Table/index.tsx +++ b/packages/amis/src/renderers/Table/index.tsx @@ -220,6 +220,7 @@ export type TableColumnWithType = SchemaObject & TableColumnObject; export type TableColumn = TableColumnWithType | TableColumnObject; type AutoFillHeightObject = Record<'height' | 'maxHeight', number>; + /** * Table 表格渲染器。 * 文档:https://aisuda.bce.baidu.com/amis/zh-CN/components/table @@ -1025,7 +1026,7 @@ export default class Table extends React.Component { const {onAction} = this.props; // todo - onAction(e, action, ctx); + return onAction(e, action, ctx); } async handleCheck(item: IRow, value?: boolean, shift?: boolean) { @@ -1375,6 +1376,7 @@ export default class Table extends React.Component { } tableUnWatchResize?: () => void; + tableRef(ref: HTMLTableElement) { this.table = ref; isAlive(this.props.store) && this.props.store.setTable(ref);