diff --git a/components/locale-provider/demo/all.md b/components/locale-provider/demo/all.md index bdd4d57cc..c6248b248 100644 --- a/components/locale-provider/demo/all.md +++ b/components/locale-provider/demo/all.md @@ -40,6 +40,14 @@ Components which need localization support are listed here, you can toggle the l <a href="#">Click to confirm</a> </a-popconfirm> </div> + <div className="example"> + <a-transfer + :dataSource="[]" + showSearch + :targetKeys="[]" + :render="item => item.title" + /> + </div> <div :style="{ width: '319px', border: '1px solid #d9d9d9', borderRadius: '4px' }"> <a-calendar :fullscreen="false" :value="moment()" /> </div> diff --git a/components/transfer/demo/custom-item.md b/components/transfer/demo/custom-item.md index b11c759ff..0457763bf 100644 --- a/components/transfer/demo/custom-item.md +++ b/components/transfer/demo/custom-item.md @@ -54,7 +54,7 @@ export default { }, renderItem(item) { const customLabel = ( - <span className="custom-item"> + <span class="custom-item"> {item.title} - {item.description} </span> ); diff --git a/components/transfer/index.jsx b/components/transfer/index.jsx index 6c73ab222..5b693fbe8 100644 --- a/components/transfer/index.jsx +++ b/components/transfer/index.jsx @@ -292,6 +292,7 @@ export default { }, renderTransfer (locale) { + const props = getOptionProps(this) const { prefixCls = 'ant-transfer', operations = [], @@ -300,11 +301,11 @@ export default { listStyle, filterOption, lazy, - render: renderItem, - } = getOptionProps(this) + } = props const notFoundContent = getComponentFromProp(this, 'notFoundContent') const { leftFilter, rightFilter, sourceSelectedKeys, targetSelectedKeys, $scopedSlots } = this const { body, footer } = $scopedSlots + const renderItem = props.render const { leftDataSource, rightDataSource } = this.splitDataSource(this.$props) const leftActive = targetSelectedKeys.length > 0 const rightActive = sourceSelectedKeys.length > 0