0.1.17 • Published 3 months ago

@saber2pr/rc-tree v0.1.17

Weekly downloads
-
License
-
Repository
github
Last release
3 months ago

@saber2pr/rc-tree

a tree-select renderer for react.

yarn add @saber2pr/rc-tree

What

example>>

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 build

Author

saber2pr

0.1.16

3 months ago

0.1.17

3 months ago

0.1.15

5 months ago

0.1.10

5 months ago

0.1.11

5 months ago

0.1.12

5 months ago

0.1.13

5 months ago

0.1.14

5 months ago

0.1.9

5 months ago

0.1.6

5 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago

0.0.9

5 years ago

0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago