Skip to content

Commit 609a7e4

Browse files
authored
Merge pull request #189 from sboldyreva/components
Vue Components
2 parents 6b73120 + 90410a1 commit 609a7e4

File tree

3 files changed

+51
-5
lines changed

3 files changed

+51
-5
lines changed

docs/.vuepress/client.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import social from "./config-client/social";
1515
import Chat from "./components/Chat.vue";
1616
import CodeTabs from "./components/CodeTabs.vue";
1717
import CodeWithCopy from "./components/CodeWithCopy.vue";
18+
import TableTabs from "./components/TableTabs.vue";
1819

1920
import CVETracker from './components/JavaSpringSolvedCveTable.vue'
2021

@@ -27,6 +28,7 @@ export default defineClientConfig({
2728
app.component("CodeTabs", CodeTabs);
2829
app.component("CodeWithCopy", CodeWithCopy);
2930
app.component("CVETracker", CVETracker);
31+
app.component("TableTabs", TableTabs);
3032
},
3133
layouts: {
3234
Layout,

docs/.vuepress/components/CodeTabs.vue

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,20 +113,34 @@ pre {
113113
background-color: transparent;
114114
color: #2d2d2d;
115115
font-size: 14px;
116-
overflow-x: auto;
117-
white-space: pre-wrap;
118-
word-wrap: break-word;
116+
white-space: pre;
119117
max-width: 100%;
120118
line-height: 1.5;
121119
box-shadow: none;
120+
overflow-x: auto;
121+
scrollbar-width: thin; /* Firefox */
122+
scrollbar-color: #666 transparent; /* Firefox */
123+
}
124+
125+
/* WebKit browsers (Chrome, Edge, Safari) */
126+
pre::-webkit-scrollbar {
127+
height: 6px;
128+
}
129+
130+
pre::-webkit-scrollbar-track {
131+
background: transparent;
132+
}
133+
134+
pre::-webkit-scrollbar-thumb {
135+
background-color: #666;
136+
border-radius: 4px;
122137
}
123138
124139
code {
125140
color: #ccc;
126141
background: none;
127142
display: block;
128-
white-space: pre-wrap;
129-
word-wrap: break-word;
143+
white-space: pre;
130144
}
131145
132146
.copy-button {
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<script setup>
2+
import { ref, computed, useSlots } from 'vue'
3+
4+
const slots = useSlots()
5+
const tabKeys = Object.keys(slots)
6+
const activeTab = ref(tabKeys[0] ?? '')
7+
const currentTab = computed(() => activeTab.value)
8+
</script>
9+
10+
<template>
11+
<div class="table-tabs mt-8 border rounded-lg overflow-hidden text-sm">
12+
<div class="bg-gray-50 flex justify-between items-center border-b">
13+
<!-- <span class="font-medium text-gray-700">Optional Text:span> -->
14+
<select
15+
v-model="activeTab"
16+
class="bg-white text-gray-800 text-sm rounded border-gray-300 focus:outline-none focus:ring-1 focus:ring-blue-500"
17+
>
18+
<option v-for="key in tabKeys" :key="key" :value="key">
19+
{{ key }}
20+
</option>
21+
</select>
22+
</div>
23+
24+
<div class="tab-content prose prose-sm max-w-none">
25+
<slot :name="currentTab" />
26+
</div>
27+
</div>
28+
</template>
29+
30+

0 commit comments

Comments
 (0)