Skip to content

Commit e2558a4

Browse files
committed
Highlight selected tag
1 parent 3dbc9f7 commit e2558a4

File tree

1 file changed

+54
-13
lines changed

1 file changed

+54
-13
lines changed

src/components/Content.vue

Lines changed: 54 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -218,15 +218,19 @@ onBeforeRouteUpdate(async (to) => {
218218
<el-container>
219219
<el-main>
220220
<div v-if="showPlaceholder" class="placeholder-message">
221-
<h2>Version {{ placeholderVersion }} Selected</h2>
222-
<p>There are {{ totalEndpoints }} endpoints available in this version.</p>
223-
<p>Please click an endpoint on the left or browse by tags below.</p>
221+
<div class="version-header">
222+
<h1>{{ placeholderVersion }}</h1>
223+
<p class="version-subtitle">API Documentation</p>
224+
</div>
225+
<p class="version-info">There are {{ totalEndpoints }} endpoints available in this version.</p>
226+
<p class="version-instructions">Please click an endpoint on the left or browse by tags below.</p>
224227

225228
<div v-if="allTags.length > 0" class="placeholder-tags">
226229
<h3>Filter by Tag:</h3>
227230
<div class="tags-grid">
228231
<a
229232
class="tag-link tag-link-all"
233+
:class="{ 'tag-link-active': !route.query.tags }"
230234
@click.prevent="clearTagFilter()"
231235
>
232236
All
@@ -235,6 +239,7 @@ onBeforeRouteUpdate(async (to) => {
235239
v-for="tag in allTags"
236240
:key="tag"
237241
class="tag-link"
242+
:class="{ 'tag-link-active': route.query.tags === tag }"
238243
@click.prevent="filterByTag(tag)"
239244
>
240245
{{ tag }}
@@ -252,11 +257,13 @@ onBeforeRouteUpdate(async (to) => {
252257
<!--<el-button text>★</el-button>-->
253258
</el-col>
254259
</el-row>
260+
<div v-html="description" class="content"></div>
255261
<div class="tags-section">
256-
<span class="tags-label">Tags ({{ tags.length }}):</span>
262+
<span class="tags-label">Tags:</span>
257263
<a
258264
v-if="route.query.tags"
259265
class="tag-link tag-link-all"
266+
:class="{ 'tag-link-active': !route.query.tags }"
260267
@click.prevent="clearTagFilter()"
261268
>
262269
All
@@ -265,13 +272,13 @@ onBeforeRouteUpdate(async (to) => {
265272
v-for="tag in tags"
266273
:key="tag"
267274
class="tag-link"
275+
:class="{ 'tag-link-active': route.query.tags === tag }"
268276
@click.prevent="filterByTag(tag)"
269277
>
270278
{{ tag }}
271279
</a>
272280
<span v-if="tags.length === 0" style="color: #909399; font-size: 12px;">No tags available</span>
273281
</div>
274-
<div v-html="description" class="content"></div>
275282
</div>
276283
</el-main>
277284
<el-footer class="footer" v-if="!showPlaceholder">
@@ -355,26 +362,60 @@ span {
355362
border-color: #85ce61;
356363
}
357364
365+
.tag-link-active {
366+
background-color: #409eff;
367+
color: white;
368+
border-color: #409eff;
369+
font-weight: 600;
370+
}
371+
372+
.tag-link-all.tag-link-active {
373+
background-color: #67c23a;
374+
border-color: #67c23a;
375+
}
376+
358377
.placeholder-message {
359-
text-align: center;
360-
padding: 60px 20px;
378+
padding: 0;
361379
color: #606266;
362380
}
363381
364-
.placeholder-message h2 {
365-
font-size: 24px;
382+
.version-header {
383+
padding: 20px 0;
384+
border-bottom: 2px solid #e4e7ed;
366385
margin-bottom: 20px;
367-
color: #39455f;
368386
}
369387
370-
.placeholder-message p {
388+
.version-header h1 {
389+
font-size: 1.75rem;
390+
font-weight: 600;
391+
color: #303133;
392+
margin: 0 0 0.5rem 0;
393+
word-wrap: break-word;
394+
overflow-wrap: break-word;
395+
}
396+
397+
.version-subtitle {
398+
font-size: 1rem;
399+
color: #909399;
400+
margin: 0;
401+
}
402+
403+
.version-info {
371404
font-size: 16px;
372-
margin: 10px 0;
405+
margin: 20px 0 10px 0;
373406
line-height: 1.6;
407+
color: #606266;
408+
}
409+
410+
.version-instructions {
411+
font-size: 16px;
412+
margin: 10px 0 20px 0;
413+
line-height: 1.6;
414+
color: #606266;
374415
}
375416
376417
.placeholder-tags {
377-
margin-top: 40px;
418+
margin-top: 30px;
378419
text-align: left;
379420
}
380421

0 commit comments

Comments
 (0)