|
6 | 6 |
|
7 | 7 | A vue 2.x component for rendering JSON data as a tree structure. |
8 | 8 |
|
| 9 | +- basic: JSON pretty |
| 10 | +- advanced: get item data from JSON |
| 11 | + |
9 | 12 | ## Links |
10 | 13 |
|
11 | 14 | - [Demo](https://leezng.github.io/vue-json-pretty) |
@@ -45,16 +48,22 @@ export default { |
45 | 48 |
|
46 | 49 | ## Props |
47 | 50 |
|
48 | | -| Attribute | Description | Type | Default | |
| 51 | +- If you are using only the basic features (JSON pretty), just focus on the `base` properties. |
| 52 | +- If you are using advanced features (get item data), you need to focus on the `base` and `advanced` attributes. |
| 53 | + |
| 54 | +| Attribute | Level | Description | Type | Default | |
49 | 55 | |-------- |-------- |-------- | -------- | |
50 | | -| data | json data | JSON object | - | |
51 | | -| path | root data path | string | root | |
52 | | -| pathChecked | defines the selected data path | array | [] | |
53 | | -| pathSelectable | defines whether a data path supports selection | Function(itemPath, itemData) | - | |
54 | | -| selectableType | defines the selected type, this feature is not supported by default | enum: both, checkbox, tree | - | |
| 56 | +| data | basic | json data | JSON object | - | |
| 57 | +| deep | basic |data depth, data larger than this depth will not be expanded | number | Infinity | |
| 58 | +| path | advanced | root data path | string | root | |
| 59 | +| pathChecked | advanced | defines the selected data path | array | [] | |
| 60 | +| pathSelectable | advanced | defines whether a data path supports selection | Function(itemPath, itemData) | - | |
| 61 | +| selectableType | advanced | defines the selected type, this feature is not supported by default | enum: both, checkbox, tree | - | |
55 | 62 |
|
56 | 63 | ## Events |
57 | 64 |
|
| 65 | +- The following events are base on advanced features. |
| 66 | + |
58 | 67 | | Event Name | Description | Callback Parameters | |
59 | 68 | |---------- |-------- |---------- | |
60 | 69 | | click | triggered when a data item is clicked | (path, data) | |
|
0 commit comments