add local-provider transfer demo

pull/9/head
tjz 2018-04-14 21:38:57 +08:00
parent c2ab98a101
commit 4d7364fe1a
3 changed files with 12 additions and 3 deletions

View File

@ -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>

View File

@ -54,7 +54,7 @@ export default {
},
renderItem(item) {
const customLabel = (
<span className="custom-item">
<span class="custom-item">
{item.title} - {item.description}
</span>
);

View File

@ -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