From 7e8554aceec3d2615a0843795570998c7c476141 Mon Sep 17 00:00:00 2001 From: kzl Date: Tue, 15 Oct 2024 11:39:56 +0800 Subject: [PATCH] =?UTF-8?q?fit=EF=BC=9A=20=E8=A7=A3=E5=86=B3=E8=A1=A8?= =?UTF-8?q?=E6=A0=BC=E8=A1=8C=E7=BC=96=E8=BE=91=E7=9A=84=E6=97=B6=E5=80=99?= =?UTF-8?q?=E7=9A=84=E5=BC=B9=E7=AA=97=EF=BC=8C=E6=97=A0=E6=B3=95=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E8=BF=94=E5=9B=9E=E5=80=BC=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/amis/src/renderers/Table/TableRow.tsx | 2 +- packages/amis/src/renderers/Table/index.tsx | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) 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 b78749b28..22f33f7ea 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);