group transfer
1.0.0
Props and events are seamlessly connected to the shuttle box of Ele.me UI.
http://element-cn.eleme.io/1.4/#/zh-CN/component/transfer
parameter | illustrate | type | Optional value | default value |
---|---|---|---|---|
data | data source | array[{ key, label, disabled,children:[] }] | - | [] |
props | Field alias for the data source | object{key, label, disabled,children} | - | - |
render-content | Custom data item rendering function | function(h, option) | - | - |
disableAll | Disable all options | Boolean | - | false |
showOverflowTooltip | Show tooltip when content is too long and is hidden | Boolean | - | false |
< ec-group-transfer
v-model =" value "
:data =' json '
filterable
@change =" handleChange "
:left-default-checked =" ['2', '3'] "
:right-default-checked =" ['4'] "
:button-texts =" ['到左边', '到右边'] "
:render-content =' renderFunc '
/>
export default {
data ( ) {
return {
json : [
{
label : '渠道名称1' ,
key : 'id1' ,
children : [
{
value : '1' ,
key : '1' ,
label : '广告位名称1' ,
} ,
{
value : '2' ,
key : '2' ,
label : '广告位名称2' ,
} ,
] ,
} ,
{
label : '渠道名称2' ,
key : 'id2' ,
children : [
{
value : '3' ,
key : '3' ,
label : '广告位名称3' ,
} ,
{
value : '4' ,
key : '4' ,
label : '广告位名称4' ,
} ,
] ,
} ,
] ,
value : [ '1' , '4' ] ,
} ;
} ,
methods : {
handleChange ( value , direction , movedKeys ) {
console . log ( value , direction , movedKeys ) ;
} ,
renderFunc ( h , option ) {
return (
< span >
{ option . key } - { option . label }
</ span >
) ;
} ,
} ,
} ;