Licence
MIT
Version
1.6.2
Deps
12
Size
979 kB
Vulns
0
Weekly
0
Tree Transfer
Explore the docs »
Repository
·
Report Bug
·
Request Feature
Table of Contents
About The Project
React tree transfer Component with antd
Fork from https://github.com/glud123/tree-transfer (last updated at 9 May 2018)
Built With
Getting Started
To get a local copy up and running follow these simple example steps.
Prerequisites
- npm
npm install npm@latest -g
Installation
- Clone the repo
git clone https://github.com/ComptiaVertigo/tree-transfer.git
- Install NPM packages
npm install
- Run
npm run dev
Usage
import React, { Component } from 'react';
import ReactDOM from 'react-dom';
import {TreeTransfer,getAllTreeData} from 'tree-transfer';
const Data = [
{
"key": "0-0",
"title": "T0-0"
},
{
"key": "0-0-0",
"title": "T0-0-0",
"parentKey": "0-0"
},
{
"key": "0-0-0-0",
"title": "T0-0-0-0",
"parentKey": "0-0-0"
},
{
"key": "0-0-0-0-0",
"title": "T0-0-0-0-0",
"parentKey": "0-0-0-0"
}
];
const leftTree = Data;
const rightTree = [];
class App extends Component {
constructor(props) {
super(props);
}
componentWillMount() {}
handleClick =()=>{
console.log(getAllTreeData());
}
render() {
return (<div style={{ height: '500px' }}>
<TreeTransfer
placeholder={'Search'}
showSearch={true}
treeWidth={250}
treeHeight={400}
getAllTreeData={getAllTreeData} leftTreeData={ leftTree } rightTreeData={ rightTree}
leftTitle={'Left'}
rightTitle={'Right'}/>
<button onClick={this.handleClick}>Tree</button>
</div>
);
}
}
ReactDOM.render(<App />,document.querySelector('#app'));
// transferBtns
[{
key: 'allToRight',
name: '>>',
className: ''
},
{
key: 'toRight',
name: '>',
className: ''
},
{
key: 'tolLeft',
name: '<',
className: ''
},
{
key: 'allToLeft',
name: '<<',
className: ''
}]
Roadmap
See the open issues for a list of proposed features (and known issues).
Contributing
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Contact
Project Link: ComptiaVertigo/tree-transfer