Skip to content

Commit ae2b15a

Browse files
committed
add local-provider transfer demo
1 parent fd11912 commit ae2b15a

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

components/locale-provider/demo/all.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,14 @@ Components which need localization support are listed here, you can toggle the l
4040
<a href="#">Click to confirm</a>
4141
</a-popconfirm>
4242
</div>
43+
<div className="example">
44+
<a-transfer
45+
:dataSource="[]"
46+
showSearch
47+
:targetKeys="[]"
48+
:render="item => item.title"
49+
/>
50+
</div>
4351
<div :style="{ width: '319px', border: '1px solid #d9d9d9', borderRadius: '4px' }">
4452
<a-calendar :fullscreen="false" :value="moment()" />
4553
</div>

components/transfer/demo/custom-item.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export default {
5454
},
5555
renderItem(item) {
5656
const customLabel = (
57-
<span className="custom-item">
57+
<span class="custom-item">
5858
{item.title} - {item.description}
5959
</span>
6060
);

components/transfer/index.jsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,7 @@ export default {
292292
},
293293

294294
renderTransfer (locale) {
295+
const props = getOptionProps(this)
295296
const {
296297
prefixCls = 'ant-transfer',
297298
operations = [],
@@ -300,11 +301,11 @@ export default {
300301
listStyle,
301302
filterOption,
302303
lazy,
303-
render: renderItem,
304-
} = getOptionProps(this)
304+
} = props
305305
const notFoundContent = getComponentFromProp(this, 'notFoundContent')
306306
const { leftFilter, rightFilter, sourceSelectedKeys, targetSelectedKeys, $scopedSlots } = this
307307
const { body, footer } = $scopedSlots
308+
const renderItem = props.render
308309
const { leftDataSource, rightDataSource } = this.splitDataSource(this.$props)
309310
const leftActive = targetSelectedKeys.length > 0
310311
const rightActive = sourceSelectedKeys.length > 0

0 commit comments

Comments
 (0)