1
1
<template >
2
- <div id =" app" class =" example-app" >
3
- <div class =" block" >
4
- <h2 >JSON Input:</h2 >
5
- <textarea v-model =" val" ></textarea >
6
-
7
- <h2 >Click Result:</h2 >
8
- <div >path: {{itemPath}}</div >
9
- <div >data: <pre >{{itemData}}</pre ></div >
2
+ <div id =" app" >
3
+ <div class =" example example-1" >
4
+ <h2 >EXAMPLE 1</h2 >
5
+ <div class =" block" >
6
+ <h3 >JSON Input:</h3 >
7
+ <textarea v-model =" val" ></textarea >
8
+ </div >
9
+ <div class =" block" >
10
+ <h3 >JSON Tree:</h3 >
11
+ <vue-json-pretty
12
+ :data =" json"
13
+ :path =" 'res'" >
14
+ </vue-json-pretty >
15
+ </div >
10
16
</div >
11
- <div class =" block" >
12
- <h2 >JSON Tree:</h2 >
13
- <vue-json-pretty
14
- :data =" json"
15
- :path =" 'res'"
16
- :path-checked =" ['res', 'res.c']"
17
- :path-selectable =" pathSelectableFn"
18
- @click =" handleClick" >
19
- </vue-json-pretty >
17
+
18
+ <div class =" example example-2" >
19
+ <h2 >EXAMPLE 2</h2 >
20
+ <div class =" block" >
21
+ <h3 >JSON Input:</h3 >
22
+ <textarea v-model =" val" ></textarea >
23
+
24
+ <h3 >Click Result:</h3 >
25
+ <div >path: {{itemPath}}</div >
26
+ <div >data: <pre >{{itemData}}</pre ></div >
27
+ </div >
28
+ <div class =" block" >
29
+ <h3 >JSON Tree:</h3 >
30
+ <vue-json-pretty
31
+ :data =" json"
32
+ :path =" 'res'"
33
+ :path-checked =" ['res', 'res.c']"
34
+ :path-selectable =" pathSelectableFn"
35
+ :selectable-type =" 'both'"
36
+ @click =" handleClick" >
37
+ </vue-json-pretty >
38
+ </div >
20
39
</div >
21
40
</div >
22
41
</template >
@@ -36,17 +55,17 @@ export default {
36
55
status: 200 ,
37
56
error: ' ' ,
38
57
data: [{
39
- news_id: ' 51184' ,
40
- title: ' 行货iPhone X评测:用真正黑科技革新未来 ' ,
41
- source: ' 网易手机 '
42
- },{
43
- news_id: ' 51183' ,
44
- title: ' 交通天堂:未来城市如何为人与无人车设计街道? ' ,
45
- source: ' 网易智能 '
46
- },{
47
- news_id: ' 51182' ,
48
- title: ' 特斯拉马斯克的美国政商关系:政府不掏一百亿不建厂 ' ,
49
- source: ' AI财经社 '
58
+ news_id: 51184 ,
59
+ title: ' iPhone X Review: Innovative future with real black technology ' ,
60
+ source: ' Netease phone '
61
+ }, {
62
+ news_id: 51183 ,
63
+ title: ' Traffic paradise: How to design streets for people and unmanned vehicles in the future? ' ,
64
+ source: ' Netease smart '
65
+ }, {
66
+ news_id: 51182 ,
67
+ title: ' Teslamask \' s American Business Relations: The government does not pay billions to build factories ' ,
68
+ source: ' AI Finance '
50
69
}]
51
70
},
52
71
itemData: {},
@@ -84,27 +103,28 @@ export default {
84
103
html , body {
85
104
margin : 0 ;
86
105
}
87
- h2 {
106
+ h2 , h3 {
88
107
margin : 0 0 10px ;
89
108
}
90
- .example-app {
109
+ .example {
91
110
padding : 10px ;
92
111
overflow : hidden ;
93
112
.block {
94
113
float : left ;
95
114
padding : 0 20px ;
96
115
width : 50% ;
97
116
box-sizing : border-box ;
98
- textarea {
99
- padding : 5px ;
100
- width : 100% ;
101
- height : 100px ;
102
- box-sizing : border-box ;
103
- }
104
- pre {
105
- margin : 0 ;
106
- font-family : Consolas;
107
- }
117
+ }
118
+ textarea {
119
+ padding : 5px ;
120
+ width : 100% ;
121
+ height : 100px ;
122
+ box-sizing : border-box ;
123
+ font-family : inherit ;
124
+ }
125
+ pre {
126
+ margin : 0 ;
127
+ font-family : Consolas;
108
128
}
109
129
}
110
130
</style >
0 commit comments