From 949f6f1a12d05984a63c64f285af1ca00686be83 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sat, 6 Feb 2016 15:54:39 +0800 Subject: [PATCH] fix eslint of no-unneeded-ternary --- components/transfer/index.jsx | 9 ++------- components/transfer/list.jsx | 2 +- 2 files changed, 3 insertions(+), 8 deletions(-) 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 ?