简单的 React 层次结构树 - 任何接受节点的 React 子元素
Simple react hierarchy tree - any React children accepted for nodes
npm install --save react-organizational-chartimport React from 'react';
import { Tree, TreeNode } from 'react-organizational-chart';
const ExampleTree = () => (
);const StyledNode = styled.div`
padding: 5px;
border-radius: 8px;
display: inline-block;
border: 1px solid red;
`;
const StyledTreeExample = () => (
Root}
>
Child 1}>
Grand Child} />
Child 2}>
Grand Child}>
Great Grand Child 1} />
Great Grand Child 2} />
Child 3}>
Grand Child 1} />
Grand Child 2} />
);Interactive examples can be found here
Tree - The root of the treeAccepts the following props:
NodeTreeNode - A node in the treeNodeI created react-organizational-chart because i could not find any other react organizational chart that supports react components as nodes.
MIT © daniel-hauser
暂无开放 Issues,或尚未同步最近议题。