diff --git a/components/transfer/index.jsx b/components/transfer/index.jsx index 245384b584..aaf8d2e607 100644 --- a/components/transfer/index.jsx +++ b/components/transfer/index.jsx @@ -101,13 +101,8 @@ class Transfer extends Component { const dataSource = direction === 'left' ? leftDataSource : rightDataSource; const filter = direction === 'left' ? leftFilter : rightFilter; const checkStatus = this.getGlobalCheckStatus(direction); - let holder = []; - - if (checkStatus === 'all') { - holder = []; - } else { - holder = this.filterDataSource(dataSource, filter).map(item => item.key); - } + const holder = (checkStatus === 'all') ? [] : + this.filterDataSource(dataSource, filter).map(item => item.key); this.setState({ [direction + 'CheckedKeys']: holder, diff --git a/components/transfer/list.jsx b/components/transfer/list.jsx index bc5c66fb1e..8987b94767 100644 --- a/components/transfer/list.jsx +++ b/components/transfer/list.jsx @@ -108,7 +108,7 @@ class TransferList extends Component { })}{(checkedKeys.length > 0 ? checkedKeys.length + '/' : '') + dataSource.length} 条 {titleText} - { bodyDom ? bodyDom : + { bodyDom ||
{ showSearch ?