From 218c3c9ed6b0760bdec1d91a4f17c317abd88710 Mon Sep 17 00:00:00 2001 From: sanmiao <877081882@qq.com> Date: Sat, 9 Oct 2021 14:06:21 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20transfer=20table=20mode=20=E5=88=97?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E4=BF=A1=E6=81=AF=E4=B8=A2=E5=A4=B1=20(#2659?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: wenyushan --- src/components/Transfer.tsx | 4 +++- src/renderers/Form/Transfer.tsx | 7 +++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/components/Transfer.tsx b/src/components/Transfer.tsx index cf29a2a6fcd..d99c0708478 100644 --- a/src/components/Transfer.tsx +++ b/src/components/Transfer.tsx @@ -276,6 +276,7 @@ export class Transfer extends React.Component { selectMode, noResultsText, searchResultColumns, + columns, classnames: cx, value, disabled, @@ -286,12 +287,13 @@ export class Transfer extends React.Component { } = this.props; const options = this.state.searchResult || []; const mode = searchResultMode || selectMode; + const resultColumns = searchResultColumns || columns; return mode === 'table' ? ( ; + /** + * 当 searchResultMode 为 table 时定义表格列信息。 + */ + searchResultColumns?: Array; + /** * 可搜索? */ @@ -252,6 +257,7 @@ export class BaseTransferRenderer< loading, searchable, searchResultMode, + searchResultColumns, deferLoad, leftOptions, leftMode, @@ -275,6 +281,7 @@ export class BaseTransferRenderer< showArrow={showArrow} selectMode={selectMode} searchResultMode={searchResultMode} + searchResultColumns={searchResultColumns} columns={columns} onSearch={searchable ? this.handleSearch : undefined} onDeferLoad={deferLoad}