Skip to content

Commit 6baf9e4

Browse files
committed
update: 文档排版优化和文字描述优化
1 parent 680e35a commit 6baf9e4

File tree

15 files changed

+646
-190
lines changed

15 files changed

+646
-190
lines changed

doc/App.vue

+109-14
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
<template>
22
<div id="app">
33
<header>
4-
<h1>{{ config.name }}</h1>
5-
<div class="command">npm install --save {{ config.name }}</div>
4+
<h1>vue-file-viewer</h1>
65
<div class="description">{{ config.description }}</div>
76
<section class="nav">
87
<router-link v-for="d in routes" :key="d.path" :to="d.path">
@@ -13,6 +12,44 @@
1312
</a>
1413
<a @click="toggleFullscreen">切换全屏</a>
1514
</section>
15+
<div
16+
class="command-container"
17+
v-if="$route.path === '/' || $route.path === '/home'"
18+
>
19+
<div class="command-title">推荐 iframe 引入方式</div>
20+
<div class="command-steps">
21+
<div class="step">
22+
<div class="step-title">STEP 1: 下载最新资源包</div>
23+
<div class="step-content">
24+
<a
25+
href="https://github.com/zyl-ui/vue-file-viewer/releases"
26+
target="_blank"
27+
class="download-link"
28+
>
29+
点此下载 releases 版本
30+
</a>
31+
</div>
32+
</div>
33+
<div class="step">
34+
<div class="step-title">
35+
STEP 2: 将项目中的 vue-file-viewer 文件夹拷贝到您自己的项目公共目录(如Pubilc文件夹下)
36+
</div>
37+
</div>
38+
<div class="step">
39+
<div class="step-title">STEP 3: iframe 引入</div>
40+
<div class="step-content code-block">
41+
<pre>
42+
<code>&lt;iframe
43+
src="./file-viewer/index.html?fileUrl=https://file-viewer.me7.cn/fileTest/pdf.pdf"
44+
scrolling="auto"
45+
id="file-viewer"
46+
style="border:0;height: 500px;width:100%"
47+
/&gt;</code>
48+
</pre>
49+
</div>
50+
</div>
51+
</div>
52+
</div>
1653
</header>
1754

1855
<router-view />
@@ -78,6 +115,76 @@ header {
78115
}
79116
}
80117
118+
.command-container {
119+
max-width: 700px;
120+
margin: 20px auto;
121+
background: color.scale(var.$primary-color, $lightness: -20%);
122+
border-radius: 6px;
123+
padding: 16px;
124+
color: white;
125+
126+
.command-title {
127+
font-size: 18px;
128+
font-weight: bold;
129+
text-align: center;
130+
margin-bottom: 16px;
131+
border-bottom: 1px solid rgba(255, 255, 255, 0.2);
132+
padding-bottom: 8px;
133+
}
134+
135+
.command-steps {
136+
.step {
137+
margin-bottom: 14px;
138+
139+
.step-title {
140+
font-weight: bold;
141+
margin-bottom: 8px;
142+
}
143+
144+
.step-content {
145+
background: rgba(0, 0, 0, 0.2);
146+
border-radius: 4px;
147+
padding: 10px;
148+
}
149+
150+
.download-link {
151+
color: #fff;
152+
text-decoration: underline;
153+
154+
&:hover {
155+
color: color.scale(var.$primary-color, $lightness: 80%);
156+
}
157+
}
158+
159+
.code-block {
160+
pre {
161+
margin: 0;
162+
overflow-x: auto;
163+
164+
code {
165+
white-space: pre;
166+
font-family: monospace;
167+
font-size: 14px;
168+
line-height: 1.5;
169+
}
170+
}
171+
}
172+
}
173+
}
174+
}
175+
176+
.command {
177+
background: color.scale(var.$primary-color, $lightness: -20%);
178+
color: white;
179+
font-family: monospace;
180+
max-width: 500px;
181+
margin: 12px auto;
182+
border-radius: 2px;
183+
padding: 12px 24px;
184+
box-sizing: border-box;
185+
text-align: center;
186+
}
187+
81188
.page-content {
82189
max-width: 1000px;
83190
margin: 0 auto;
@@ -147,18 +254,6 @@ a:hover {
147254
color: color.scale(var.$primary-color, $lightness: 20%);
148255
}
149256
150-
.command {
151-
background: color.scale(var.$primary-color, $lightness: -20%);
152-
color: white;
153-
font-family: monospace;
154-
max-width: 500px;
155-
margin: 12px auto;
156-
border-radius: 2px;
157-
padding: 12px 24px;
158-
box-sizing: border-box;
159-
text-align: center;
160-
}
161-
162257
.description {
163258
color: white;
164259
font-size: 15px;

doc/router.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ import Start from './views/Start.vue'
1313
Vue.use(VueRouter)
1414

1515
export const routes = [
16-
{ path: '/', name: 'Home', component: Home },
17-
{ path: '/start', name: '快速上手', component: Start },
16+
{ path: '/', name: '快速上手', component: Home },
17+
{ path: '/start', name: '使用文档', component: Start },
1818
{ path: '*', redirect: '/' }
1919
]
2020

0 commit comments

Comments
 (0)