@@ -15,31 +15,43 @@ Demo: http://cheton.github.io/react-infinite-tree
15
15
* A rich set of [ APIs] ( https://github.com/cheton/infinite-tree#api-documentation )
16
16
17
17
## Browser Support
18
- ![ Chrome] ( https://raw.github.com/alrra/browser-logos/master/chrome/chrome_48x48.png ) <br >Chrome | ![ Edge] ( https://raw.github.com/alrra/browser-logos/master/edge/edge_48x48.png ) <br >Edge | ![ Firefox] ( https://raw.github.com/alrra/browser-logos/master/firefox/firefox_48x48.png ) <br >Firefox | ![ IE] ( https://raw.github.com/alrra/browser-logos/master/internet-explorer/internet-explorer_48x48.png ) <br >IE |
19
- ![ Opera] ( https://raw.github.com/alrra/browser-logos/master/opera/opera_48x48.png ) <br >Opera | ![ Safari] ( https://raw.github.com/alrra/browser-logos/master/safari/safari_48x48.png ) <br >Safari
18
+ ![ Chrome] ( https://raw.github.com/alrra/browser-logos/master/chrome/chrome_48x48.png ) <br >Chrome | ![ Edge] ( https://raw.github.com/alrra/browser-logos/master/edge/edge_48x48.png ) <br >Edge | ![ Firefox] ( https://raw.github.com/alrra/browser-logos/master/firefox/firefox_48x48.png ) <br >Firefox | ![ IE] ( https://raw.github.com/alrra/browser-logos/master/internet-explorer/internet-explorer_48x48.png ) <br >IE | ![ Opera] ( https://raw.github.com/alrra/browser-logos/master/opera/opera_48x48.png ) <br >Opera | ![ Safari] ( https://raw.github.com/alrra/browser-logos/master/safari/safari_48x48.png ) <br >Safari
20
19
--- | --- | --- | --- | --- | --- |
21
20
Yes | Yes | Yes| 9+ | Yes | Yes |
22
21
23
- ## Notice
24
- <i >The project is under heavy development and a lot of things are changing. Stay tuned for further updates.</i >
25
-
26
22
## Installation
27
23
``` bash
28
24
npm install --save react react-dom infinite-tree
29
25
npm install --save react-infinite-tree
30
26
```
31
27
32
- ## Usage
28
+ ## Example
33
29
``` jsx
34
30
import React from ' react' ;
35
31
import InfiniteTree from ' react-infinite-tree' ;
36
32
import ' react-infinite-tree/dist/react-infinite-tree.css' ;
37
33
34
+ const data = {
35
+ id: ' fruit' ,
36
+ label: ' Fruit' ,
37
+ children: [{
38
+ id: ' apple' ,
39
+ label: ' Apple'
40
+ }, {
41
+ id: ' banana' ,
42
+ label: ' Banana' ,
43
+ children: [{
44
+ id: ' cherry' ,
45
+ label: ' Cherry' ,
46
+ loadOnDemand: true
47
+ }]
48
+ }]
49
+ };
50
+
38
51
class App extends React .Component {
39
52
tree = null ;
40
53
41
54
componentDidMount () {
42
- const data = generateData ();
43
55
this .tree .loadData (data);
44
56
45
57
// Select the first node
@@ -103,7 +115,7 @@ class App extends React.Component {
103
115
104
116
## API Documentation
105
117
106
- Check out API documentation from [ infinite-tree] ( https://github.com/cheton/infinite-tree/wiki ) :
118
+ Check out API documentation at [ infinite-tree] ( https://github.com/cheton/infinite-tree/wiki ) :
107
119
108
120
* [ Options] ( https://github.com/cheton/react-infinite-tree/wiki/Options )
109
121
* [ Functions: Tree] ( https://github.com/cheton/react-infinite-tree/wiki/Functions:-Tree )
0 commit comments