1.0.2 • Published 1 year ago

@sinoyd/transfer-three v1.0.2

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

基于 element-ui 组件 el-transfer 的三段式穿梭框

预览

gitlab

npmjs

安装

npm install @sinoyd/transfer-three

使用

<script>
import TransferThree from '@sinoyd/transfer-three';

export default {
  components: {
    TransferThree,
  },
  data() {
    return {
      // 数据源
      data: [],
      // 左侧数据
      leftValue: [],
      // 右侧数据
      rightValue: [],
    };
  },
}
</script>

<template>
  <div style="height: 500px">
    <TransferThree
      mode="copy"
      filterable
      filter-placeholder="请输入"
      :data="data"
      :left-value.sync="leftValue"
      :right-value.sync="rightValue"
      :titles="['left', 'source', 'right']"
      :props="{ key: 'key', label: 'label' }"
      @change="onChange"
    ></TransferThree>
  </div>
</template>

props

参数说明类型默认值
mode默认,为copy时,则移动时保留数据源string''
filterable是否开启检索booleanfalse
filter-placeholder检索占位文本string请输入搜索内容
titles自定义列表标题string[]'列表 1', '列表 2', '列表 3'
left-value左侧绑定值array
right-value右侧绑定值array
data数据源array{ key, label, disabled }
props数据源的字段别名object{key, label, disabled}

event

事件名称说明回调参数
change列表元素变化时触发当前值left, right、数据移动的方向('left' / 'right')
1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago