Skip to content

Commit 3dbc9f7

Browse files
committed
All link
1 parent 7b4136f commit 3dbc9f7

File tree

1 file changed

+33
-1
lines changed

1 file changed

+33
-1
lines changed

src/components/Content.vue

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,13 @@ const filterByTag = (tag: string) => {
8282
})
8383
}
8484
85+
const clearTagFilter = () => {
86+
router.push({
87+
name: 'api',
88+
params: { version: version }
89+
})
90+
}
91+
8592
const setPager = (id: string): void => {
8693
const target = document.getElementById(id)?.parentElement
8794
if (target) {
@@ -213,11 +220,17 @@ onBeforeRouteUpdate(async (to) => {
213220
<div v-if="showPlaceholder" class="placeholder-message">
214221
<h2>Version {{ placeholderVersion }} Selected</h2>
215222
<p>There are {{ totalEndpoints }} endpoints available in this version.</p>
216-
<p>Please click an endpoint on the left to view its details.</p>
223+
<p>Please click an endpoint on the left or browse by tags below.</p>
217224

218225
<div v-if="allTags.length > 0" class="placeholder-tags">
219226
<h3>Filter by Tag:</h3>
220227
<div class="tags-grid">
228+
<a
229+
class="tag-link tag-link-all"
230+
@click.prevent="clearTagFilter()"
231+
>
232+
All
233+
</a>
221234
<a
222235
v-for="tag in allTags"
223236
:key="tag"
@@ -241,6 +254,13 @@ onBeforeRouteUpdate(async (to) => {
241254
</el-row>
242255
<div class="tags-section">
243256
<span class="tags-label">Tags ({{ tags.length }}):</span>
257+
<a
258+
v-if="route.query.tags"
259+
class="tag-link tag-link-all"
260+
@click.prevent="clearTagFilter()"
261+
>
262+
All
263+
</a>
244264
<a
245265
v-for="tag in tags"
246266
:key="tag"
@@ -323,6 +343,18 @@ span {
323343
border-color: #409eff;
324344
}
325345
346+
.tag-link-all {
347+
background-color: #67c23a;
348+
border-color: #b3e19d;
349+
color: white;
350+
font-weight: 600;
351+
}
352+
353+
.tag-link-all:hover {
354+
background-color: #85ce61;
355+
border-color: #85ce61;
356+
}
357+
326358
.placeholder-message {
327359
text-align: center;
328360
padding: 60px 20px;

0 commit comments

Comments
 (0)