Skip to content
This repository has been archived by the owner on Oct 18, 2018. It is now read-only.

Commit

Permalink
Merge pull request #23 from hckhanh/build
Browse files Browse the repository at this point in the history
Update content in README
  • Loading branch information
hckhanh authored Aug 16, 2016
2 parents 0e0a492 + e7c1466 commit 26c6aac
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
22 changes: 15 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,22 @@ npm install --save react-tree-es6

## Usage

import/require `ReactTree` to your React source code:
import/require `ReactTree` in your source code:

```js
import ReactTree from 'react-tree-es6';
```

and add this component into your `render()` function:

```js
render() {
<ReactTree core={CORE} onChanged={this.handleOnChanged} />
}
```

**Go to [example](example) folder to get more details.**

### core

`core` is the jsTree object contains basic data and configurations of the tree.
Expand Down Expand Up @@ -71,7 +81,7 @@ As you know, a tree has one or many nodes, here is the full structure of a node:
}
```

You can define a `core` object and then parse it to `core` property:
You can define a `core` object and then put it to `core` property:

```js
const CORE = {
Expand Down Expand Up @@ -100,7 +110,7 @@ class ExampleApp extends React.Component {
}
```

> To make sure you can find what you need, go to [jsTree API](https://www.jstree.com/api) for more details.
**To make sure you can find what you need, go to [jsTree API](https://www.jstree.com/api) for more details.**

### onChanged

Expand Down Expand Up @@ -152,14 +162,12 @@ class ExampleApp extends React.Component {
}
```

If you need detailed example, go to [example](example) folder.

### Themes

If user want to apply css for **ReactTree**, consider to include these files to your web app:

* node_modules/jstree/dist/themes/default/style.min.css
* node_modules/jstree/dist/themes/default-dark/style.min.css
* node_modules/jstree/dist/themes/**default**/style.min.css
* node_modules/jstree/dist/themes/**default-dark**/style.min.css

with additional options in `core` object, for instance with **default-dark** theme:

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-tree-es6",
"version": "1.0.0-0",
"version": "1.0.0",
"description": "The wrapper of jsTree (jstree.com) for React",
"main": "./lib/react-tree.js",
"scripts": {
Expand Down

0 comments on commit 26c6aac

Please sign in to comment.