update Transfer
update Transfer
This commit is contained in:
parent
77f7bb9533
commit
37ee153528
3 changed files with 15 additions and 4 deletions
|
@ -11,13 +11,13 @@
|
||||||
:query.sync="query"
|
:query.sync="query"
|
||||||
:placeholder="filterPlaceholder"></Search>
|
:placeholder="filterPlaceholder"></Search>
|
||||||
</div>
|
</div>
|
||||||
<ul :class="prefixCls + '-content'" v-if="showItems.length">
|
<ul :class="prefixCls + '-content'">
|
||||||
<li
|
<li
|
||||||
v-for="item in showItems | filterBy filterData"
|
v-for="item in showItems | filterBy filterData"
|
||||||
:class="[prefixCls + '-content-item', {[prefixCls + '-content-item-disabled']: item.disabled}]"
|
: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>
|
@click.prevent="select(item)"><Checkbox :checked="isCheck(item)" :disabled="item.disabled">{{ showLabel(item) }}</Checkbox></li>
|
||||||
|
<li :class="prefixCls + '-content-not-found'">{{ notFoundText }}</li>
|
||||||
</ul>
|
</ul>
|
||||||
<div :class="prefixCls + '-body-not-found'" v-else>{{ notFoundText }}</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div :class="prefixCls + '-footer'">
|
<div :class="prefixCls + '-footer'">
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
|
@ -30,7 +30,6 @@
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: { Search, Checkbox },
|
components: { Search, Checkbox },
|
||||||
// filters: { filterData: this.filterData },
|
|
||||||
props: {
|
props: {
|
||||||
prefixCls: String,
|
prefixCls: String,
|
||||||
data: Array,
|
data: Array,
|
||||||
|
|
|
@ -53,6 +53,15 @@
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
text-overflow: ellipsis;
|
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{
|
&-body-with-search &-content{
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
|
|
@ -9,7 +9,6 @@
|
||||||
:data="data"
|
:data="data"
|
||||||
filterable
|
filterable
|
||||||
:target-keys.sync="targetKeys"
|
:target-keys.sync="targetKeys"
|
||||||
:selected-keys="selectedKeys"
|
|
||||||
:operations="['向左移动','向右移动']"
|
:operations="['向左移动','向右移动']"
|
||||||
@on-change="change"></Transfer>
|
@on-change="change"></Transfer>
|
||||||
</div>
|
</div>
|
||||||
|
@ -35,6 +34,10 @@
|
||||||
change (newTargetKeys, direction, moveKeys) {
|
change (newTargetKeys, direction, moveKeys) {
|
||||||
// console.log(newTargetKeys)
|
// console.log(newTargetKeys)
|
||||||
this.targetKeys = newTargetKeys;
|
this.targetKeys = newTargetKeys;
|
||||||
|
},
|
||||||
|
filterMethod (data, query) {
|
||||||
|
if (query === '') return true;
|
||||||
|
return data.label === query;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue