update Transfer

update Transfer
This commit is contained in:
梁灏 2016-11-18 12:02:09 +08:00
parent 77f7bb9533
commit 37ee153528
3 changed files with 15 additions and 4 deletions

View file

@ -11,13 +11,13 @@
:query.sync="query"
:placeholder="filterPlaceholder"></Search>
</div>
<ul :class="prefixCls + '-content'" v-if="showItems.length">
<ul :class="prefixCls + '-content'">
<li
v-for="item in showItems | filterBy filterData"
:class="[prefixCls + '-content-item', {[prefixCls + '-content-item-disabled']: item.disabled}]"
@click.prevent="select(item)"><Checkbox :checked="isCheck(item)" :disabled="item.disabled">{{ showLabel(item) }}</Checkbox></li>
<li :class="prefixCls + '-content-not-found'">{{ notFoundText }}</li>
</ul>
<div :class="prefixCls + '-body-not-found'" v-else>{{ notFoundText }}</div>
</div>
<div :class="prefixCls + '-footer'">
<slot></slot>
@ -30,7 +30,6 @@
export default {
components: { Search, Checkbox },
// filters: { filterData: this.filterData },
props: {
prefixCls: String,
data: Array,

View file

@ -53,6 +53,15 @@
white-space: nowrap;
text-overflow: ellipsis;
}
&-not-found{
display: none;
text-align: center;
color: @btn-disable-color;
}
li&-not-found:only-child{
display: block;
}
}
&-body-with-search &-content{
padding: 0;

View file

@ -9,7 +9,6 @@
:data="data"
filterable
:target-keys.sync="targetKeys"
:selected-keys="selectedKeys"
:operations="['向左移动','向右移动']"
@on-change="change"></Transfer>
</div>
@ -35,6 +34,10 @@
change (newTargetKeys, direction, moveKeys) {
// console.log(newTargetKeys)
this.targetKeys = newTargetKeys;
},
filterMethod (data, query) {
if (query === '') return true;
return data.label === query;
}
}
}