From 4f73b0e9721d7ba9441220896f2379e87e373d79 Mon Sep 17 00:00:00 2001 From: ChasLui <402430161@qq.com> Date: Sat, 12 Oct 2019 13:34:51 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20action=20=E5=88=97=E8=A1=A8=E5=90=8D?= =?UTF-8?q?=E7=A7=B0=E5=8F=AF=E4=BB=A5=E8=87=AA=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit actions 列名应该能自定义 --- src/index.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/index.tsx b/src/index.tsx index a4a1bbb..431cb85 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -99,6 +99,7 @@ export interface IDataTableProps { searchBtnText?: string, clearBtnText?: string, listSelectionBtnText?: string, + actionColumnText: string, /** 最大的表单项显示数,当表单项超过此数值时,会自动出现 collapse 按钮 */ maxVisibleFieldCount?: number, pageSize?: number, @@ -182,7 +183,7 @@ export class DataTable extends React.Component listSelectionBtnText: 'List selection' } - readonly actionsColumn = this.props.rowActions && { key: 'actions', title: 'Actions', render: (record) => { return renderActions(this.props.rowActions as RowAction[], record) } } as ColumnProps + readonly actionsColumn = this.props.rowActions && { key: 'actions', title: this.props.actionColumnText || 'Actions', render: (record) => { return renderActions(this.props.rowActions as RowAction[], record) } } as ColumnProps readonly shouldShowTableTitle = this.props.title || this.props.enableListSelection From e81a60062ab52eddc2ec5887acc1bc1b3a9c9fcc Mon Sep 17 00:00:00 2001 From: ChasLui <402430161@qq.com> Date: Sat, 12 Oct 2019 13:35:58 +0800 Subject: [PATCH 2/2] =?UTF-8?q?docs:=20action=20=E5=88=97=E5=90=8D?= =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit docs: action 列名自定义 --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 47c0c99..923f7ab 100644 --- a/README.md +++ b/README.md @@ -318,6 +318,8 @@ type SearchInfo = { ### `listSelectionBtnText?: string` +### `actionColumnText?: string` + ### `onError? (err): void` Error handler that trigger when onSearch throw error.