mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-28 05:05:48 +08:00
fix eslint of no-unneeded-ternary
This commit is contained in:
parent
7c7e8beed2
commit
949f6f1a12
@ -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,
|
||||
|
@ -108,7 +108,7 @@ class TransferList extends Component {
|
||||
})}<span className={`${prefixCls}-header-selected`}><span>{(checkedKeys.length > 0 ? checkedKeys.length + '/' : '') + dataSource.length} 条</span>
|
||||
<span className={`${prefixCls}-header-title`}>{titleText}</span></span>
|
||||
</div>
|
||||
{ bodyDom ? bodyDom :
|
||||
{ bodyDom ||
|
||||
<div className={ showSearch ? `${prefixCls}-body ${prefixCls}-body-with-search` : `${prefixCls}-body`}>
|
||||
{ showSearch ? <div className={`${prefixCls}-body-search-wrapper`}>
|
||||
<Search prefixCls={`${prefixCls}-search`} onChange={this.handleFilter.bind(this)} handleClear={this.handleClear.bind(this)} value={filter} />
|
||||
|
Loading…
Reference in New Issue
Block a user