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 href="#">Click to confirm</a>
</a-popconfirm> </a-popconfirm>
</div> </div>
<div className="example">
<a-transfer
:dataSource="[]"
showSearch
:targetKeys="[]"
:render="item => item.title"
/>
</div>
<div :style="{ width: '319px', border: '1px solid #d9d9d9', borderRadius: '4px' }"> <div :style="{ width: '319px', border: '1px solid #d9d9d9', borderRadius: '4px' }">
<a-calendar :fullscreen="false" :value="moment()" /> <a-calendar :fullscreen="false" :value="moment()" />
</div> </div>

View File

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

View File

@ -292,6 +292,7 @@ export default {
}, },
renderTransfer (locale) { renderTransfer (locale) {
const props = getOptionProps(this)
const { const {
prefixCls = 'ant-transfer', prefixCls = 'ant-transfer',
operations = [], operations = [],
@ -300,11 +301,11 @@ export default {
listStyle, listStyle,
filterOption, filterOption,
lazy, lazy,
render: renderItem, } = props
} = getOptionProps(this)
const notFoundContent = getComponentFromProp(this, 'notFoundContent') const notFoundContent = getComponentFromProp(this, 'notFoundContent')
const { leftFilter, rightFilter, sourceSelectedKeys, targetSelectedKeys, $scopedSlots } = this const { leftFilter, rightFilter, sourceSelectedKeys, targetSelectedKeys, $scopedSlots } = this
const { body, footer } = $scopedSlots const { body, footer } = $scopedSlots
const renderItem = props.render
const { leftDataSource, rightDataSource } = this.splitDataSource(this.$props) const { leftDataSource, rightDataSource } = this.splitDataSource(this.$props)
const leftActive = targetSelectedKeys.length > 0 const leftActive = targetSelectedKeys.length > 0
const rightActive = sourceSelectedKeys.length > 0 const rightActive = sourceSelectedKeys.length > 0