Skip to content

Commit 54c28ca

Browse files
committed
样式优化,example组件更新,展示2个example,CI邮箱修改
1 parent 43a26ea commit 54c28ca

File tree

3 files changed

+62
-44
lines changed

3 files changed

+62
-44
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
- git remote add origin "https://${GH_TOKEN}@${GH_REF}"
2929
- git checkout -b gh-pages
3030
- git config user.name "leezng"
31-
- git config user.email "leezng@163.com"
31+
- git config user.email "im.leezng@gmail.com"
3232
- git add .
3333
- git commit -m "update example page"
3434
- git push --force --quiet "https://${GH_TOKEN}@${GH_REF}" gh-pages:gh-pages

example/App.vue

+60-40
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,41 @@
11
<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>
1016
</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>
2039
</div>
2140
</div>
2241
</template>
@@ -36,17 +55,17 @@ export default {
3655
status: 200,
3756
error: '',
3857
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'
5069
}]
5170
},
5271
itemData: {},
@@ -84,27 +103,28 @@ export default {
84103
html, body {
85104
margin: 0;
86105
}
87-
h2 {
106+
h2, h3 {
88107
margin: 0 0 10px;
89108
}
90-
.example-app {
109+
.example {
91110
padding: 10px;
92111
overflow: hidden;
93112
.block {
94113
float: left;
95114
padding: 0 20px;
96115
width: 50%;
97116
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;
108128
}
109129
}
110130
</style>

src/assets/less/tree.less

+1-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
.vjs__tree {
44
font-family: "Monaco", "Menlo", "Consolas", "Bitstream Vera Sans Mono";
5-
line-height: 1.5;
5+
line-height: 1.3;
66
.vjs__tree__content {
77
padding-left: @content-padding;
88
border-left: 1px dotted #ccc;
@@ -21,12 +21,10 @@
2121
left: -30px;
2222
}
2323
.vjs__value__null {
24-
font-weight: bold;
2524
color: #ff4949;
2625
}
2726
.vjs__value__number,
2827
.vjs__value__boolean {
29-
font-weight: bold;
3028
color: #1d8ce0;
3129
}
3230
.vjs__value__string {

0 commit comments

Comments
 (0)