2
0
mirror of https://github.com/tenrok/vue-json-viewer.git synced 2026-06-20 20:00:37 +03:00

add an option to enable key sorting before display

This commit is contained in:
STAFYNIAK Sacha
2018-09-17 07:31:45 +02:00
parent a33910098a
commit 02c69c472c
4 changed files with 42 additions and 19 deletions
+17 -11
View File
@@ -4,20 +4,25 @@ Simple json display component, based on vue
## Installing:
Using npm:
```
```
$ npm install vue-json-viewer
```
Using bower:
```
```
$ yarn add vue-json-viewer
```
## Example:
``` html
<json-viewer :value="jsonData" :show-copy="true" icon-prefix="ion" :show-bigger="true"></json-viewer>
``` html
<json-viewer
:value="jsonData"
:show-copy="true"
icon-prefix="ion"
:show-bigger="true"
:sort-keys="true" />
```
``` js
@@ -42,14 +47,15 @@ export default {
}
```
## Result:
![ABC](http://oxqqtdux0.bkt.clouddn.com/WX20180702-172158.png)
![ABC](http://oxqqtdux0.bkt.clouddn.com/WX20180702-172158.png)
## Options:
| Property | Description |
| ----------- |:-------------|
| value | json data |
| show-copy | display the copy button |
| show-bigger | display the bigger button |
| icon-prefix | Custom Font icon prefix |
| Property | Description |
| ----------- |:------------- |
| value | json data |
| show-copy | display the copy button |
| show-bigger | display the bigger button |
| icon-prefix | Custom Font icon prefix |
| sort-keys | Sort items by key names |