0.1.17 • Published 2 years ago
@saber2pr/rc-tree v0.1.17
@saber2pr/rc-tree
a tree-select renderer for react.
yarn add @saber2pr/rc-treeWhat
import Tree from "@saber2pr/rc-tree";
const tree = {
  path: "root",
  name: "root",
  children: [
    {
      path: "root/node",
      name: "node",
      children: [
        {
          path: "root/node/node.md",
          name: "node",
          text: "node\n"
        }
      ]
    }
  ]
};
const App = () => (
  <Tree from={tree} map={node => <a href={node.path}>{node.name}</a>} />
);
ReactDOM.render(<App />, document.getElementById("root"));
// map depth
const TreeSelect = (
  <Tree
    from={tree}
    map={(node, depth) => (
      <a style={{ color: depth > 1 ? "red" : "green" }}>{node.name}</a>
    )}
  />
);dev
yarn install
yarn run dev
yarn run buildAuthor
saber2pr
0.1.16
2 years ago
0.1.17
2 years ago
0.1.15
2 years ago
0.1.10
2 years ago
0.1.11
2 years ago
0.1.12
2 years ago
0.1.13
2 years ago
0.1.14
2 years ago
0.1.9
2 years ago
0.1.6
6 years ago
0.1.5
6 years ago
0.1.4
6 years ago
0.1.3
6 years ago
0.1.2
6 years ago
0.1.1
6 years ago
0.1.0
6 years ago
0.0.9
6 years ago
0.0.8
6 years ago
0.0.7
6 years ago
0.0.6
6 years ago
0.0.5
6 years ago
0.0.4
6 years ago
0.0.3
6 years ago
0.0.2
6 years ago
0.0.1
6 years ago