diff --git a/components/transfer/demo/search.md b/components/transfer/demo/search.md index 1911b69151f81225e34f737e14a6ac464f9a66af..31707a36e2e4fcd06d2024a584961006fb2dac8b 100644 --- a/components/transfer/demo/search.md +++ b/components/transfer/demo/search.md @@ -44,6 +44,7 @@ const App = React.createClass({ item.title} /> diff --git a/components/transfer/index.jsx b/components/transfer/index.jsx index 283ec9629f4be8fcb9b1544faaf313e42aca90ba..eef2f2b9e637cd090be9ac5286e4c6a59f3a47fb 100644 --- a/components/transfer/index.jsx +++ b/components/transfer/index.jsx @@ -147,7 +147,7 @@ class Transfer extends Component { render() { const { - prefixCls, titles, operations, showSearch, + prefixCls, titles, operations, showSearch, notFoundContent, searchPlaceholder, body, footer, listStyle, className, } = this.props; const { leftFilter, rightFilter, leftCheckedKeys, rightCheckedKeys } = this.state; @@ -180,6 +180,7 @@ class Transfer extends Component { render={this.props.render} showSearch={showSearch} searchPlaceholder={searchPlaceholder} + notFoundContent={notFoundContent} body={body} footer={footer} prefixCls={`${prefixCls}-list`} /> @@ -204,6 +205,7 @@ class Transfer extends Component { render={this.props.render} showSearch={showSearch} searchPlaceholder={searchPlaceholder} + notFoundContent={notFoundContent} body={body} footer={footer} prefixCls={`${prefixCls}-list`} /> @@ -222,7 +224,7 @@ Transfer.defaultProps = { operations: [], showSearch: false, searchPlaceholder: '请输入搜索内容', - notFoundContent: '请输入搜索内容', + notFoundContent: 'Not Found', body: noop, footer: noop, }; @@ -240,6 +242,7 @@ Transfer.propTypes = { operations: PropTypes.array, showSearch: PropTypes.bool, searchPlaceholder: PropTypes.string, + notFoundContent: PropTypes.node, body: PropTypes.func, footer: PropTypes.func, }; diff --git a/components/transfer/index.md b/components/transfer/index.md index ece3889de39c8abf115b4b19d60f14a7985fc04e..51326c12f93ae21ae5650e0f3dea296dc224766c 100644 --- a/components/transfer/index.md +++ b/components/transfer/index.md @@ -28,4 +28,5 @@ | operations | 操作文案集合,顺序从上至下 | Array | [] | | showSearch | 是否显示搜索框 | Boolean | false | | searchPlaceholder | 搜索框的默认值 | String | 请输入搜索的内容 | +| notFoundContent | 当列表为空时显示的内容 | React.node | 'Not Found' | | footer | 底部渲染函数 | Function(props) | | | diff --git a/components/transfer/list.jsx b/components/transfer/list.jsx index 5f038eb0b9b2d1bb9da4f3f4cd9481917a47aba2..0b34cc291373236078b4486232d104b684afdf6a 100644 --- a/components/transfer/list.jsx +++ b/components/transfer/list.jsx @@ -69,7 +69,7 @@ class TransferList extends Component { } render() { - const { prefixCls, dataSource, titleText, filter, checkedKeys, + const { prefixCls, dataSource, titleText, filter, checkedKeys, notFoundContent, checkStatus, body, footer, showSearch, searchPlaceholder } = this.props; // Custom Layout @@ -118,7 +118,7 @@ class TransferList extends Component { - {showItems.length > 0 ? showItems :
Not Found
} + {showItems.length > 0 ? showItems :
{notFoundContent}
}
} { footerDom ?
diff --git a/style/components/transfer.less b/style/components/transfer.less index cbcdffc2b675bae0f9d699db0a116d856a0f0365..fffeebc64057535a698dc3769cec38a99c0389b0 100644 --- a/style/components/transfer.less +++ b/style/components/transfer.less @@ -66,9 +66,10 @@ } &-not-found { - margin-top: 24px; + padding-top: 24px; color: #ccc; text-align: center; + height: 100%; } ul {