You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+8-24Lines changed: 8 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,8 +4,6 @@ Engligh | [中文](./README_ZH.md)
4
4
5
5
`<ReactJsonView />` is a React component for displaying JSON data.
6
6
7
-
The component accepts source data of _string_ type, which means you need to ensure that the data passed in is valid JSON string and can be parsed without errors using the `JSON.parse()` method. Otherwise, the data will be converted to a _string_ type before being processed.
8
-
9
7
## Install
10
8
11
9
```bash
@@ -30,17 +28,7 @@ import ReactDOM from 'react-dom';
description: 'The component accepts source data of *string* type, which means you need to ensure that the data passed in is valid JSON string and can be parsed without errors using the `JSON.parse()` method.',
42
-
},
43
-
]);
31
+
const data = [1,2,3,4]
44
32
45
33
const App = () => {
46
34
return (
@@ -64,10 +52,6 @@ ReactDOM.render(
64
52
)
65
53
```
66
54
67
-
Now you should get that after above:
68
-
69
-

70
-
71
55
## Config
72
56
73
57
The default configuration usage:
@@ -82,13 +66,13 @@ The default configuration usage:
|`keyCount`|`number / "all"`|`200`|`ReactJsonView` supports lazily loading more properties. The parameter indicates how many properties to show at a time, and you can pass `"all"` to show all properties. |
91
-
|`maxTitleSize`|`number`|`100`| The max length of abbreviated title in collapse. |
|`defaultExpand`|`boolean / number`|`false`| Whether expand property panel. Expand at a particular depth if you pass a integer value.|
74
+
|`keyCount`|`number / "all"`|`200`|`ReactJsonView` supports lazily loading more properties. The parameter indicates how many properties to show at a time, and you can pass `"all"` to show all properties. |
75
+
|`maxTitleSize`|`number`|`100`| The max length of abbreviated title in collapse.|
description: 'The component accepts source data of *string* type, which means you need to ensure that the data passed in is valid JSON string and can be parsed without errors using the `JSON.parse()` method.',
Copy file name to clipboardExpand all lines: examples/App.tsx
+49-18Lines changed: 49 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -1,30 +1,61 @@
1
1
importReactJsonViewfrom'../dist/index';
2
2
import'../dist/style.css';
3
-
importjsonfrom'./assets/data.json?raw';
3
+
importjsonfrom'./assets/data.json';
4
4
5
-
constdata=JSON.stringify([
6
-
1,
7
-
true,
8
-
'Hello world',
9
-
['foo','bar','baz'],
5
+
constdata=[
10
6
{
11
-
name: '@huolala-tech/react-json-view',
12
-
contributor: 'wqcstrong',
13
-
description:
14
-
'The component accepts source data of string type, which means you need to ensure that the data passed in is valid JSON string and can be parsed without errors using the JSON.parse() method.',
7
+
type: 'Primitive',
8
+
data: 'Hello, @huolala-tech/react-json-view',
15
9
},
16
-
]);
10
+
{
11
+
type: 'Normal',
12
+
data: {
13
+
name: '@huolala-tech/react-json-view',
14
+
contributor: 'wqcstrong',
15
+
description:
16
+
'<ReactJsonView /> is a react component for display json tree, it accepts the valid json object as the source and show them',
0 commit comments