0.0.5 • Published 5 years ago

lucio-tree-transfer v0.0.5

Weekly downloads
4
License
MIT
Repository
github
Last release
5 years ago

lucio-tree-transfer


React tree transfer Component with antd

NPM version NPM downloads Test coverage

Install

rc-rate

Development

npm install
npm start

Example

http://localhost:9000/

online example: https://luciojs.github.io/tree-transfer/

Usage

import React, { Component } from 'react';
import TreeTransfer from 'lucio-tree-transfer';

const source = [
  {
    key: '0',
    title: '0',
    children: [
      {
        key: '0-0',
        title: '0-0',
      },
      {
        key: '0-1',
        title: '0-1',
      }
    ]
  }
],

class App extends Component {
  state = {
    target: ['0-1']
  }

  handleChange = (target) => {
    this.setState({
      target
    });
  }

  render() {
    return <TreeTransfer source={source} target={this.state.target} onChange={this.handleChange}>
  }
}

render(<App />, document.querySelector('#app'));

API

参数说明类型默认值
className选择器 classNameString-
rowKey指定数据列的keyString'key'
rowTitle指定数据列的titleString'title'
rowChildren指定数据列的childrenString'children'
source数据源,其中的数据将会被渲染到左侧框(Tree)中Array[]
target显示在右侧框数据的key集合Array[]
sourceTitle左侧框标题String'源数据'
targetTitle右侧框标题String'目的数据'
treeLoading加载状态Booleanfalse
showSearch是否显示搜索框Booleanfalse
onLoadData异步加载数据function(node)-
onTreeSearch异步搜索数据function(value)-

License

lucio-tree-transfer is released under the MIT license.

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

1.0.0-beta.1

6 years ago