Commit 304ac1badc
Unsigned
Layout: unified · split
docs/.vitepress/theme/components/Collapsible.vue +2 −31
| @@ -1,19 +1,11 @@ | ||
| 1 | 1 | <script setup lang="ts"> |
| 2 | import { computed, ref } from 'vue' | |
| 2 | import { ref } from 'vue' | |
| 3 | 3 | |
| 4 | 4 | const props = defineProps<{ |
| 5 | 5 | title?: string |
| 6 | 6 | }>() |
| 7 | 7 | |
| 8 | 8 | const open = ref(false) |
| 9 | ||
| 10 | const slug = computed(() => { | |
| 11 | const text = props.title || 'Details' | |
| 12 | return text | |
| 13 | .toLowerCase() | |
| 14 | .replace(/\s+/g, '-') | |
| 15 | .replace(/[^\w-]/g, '') | |
| 16 | }) | |
| 17 | 9 | </script> |
| 18 | 10 | |
| 19 | 11 | <template> |
| @@ -21,10 +13,7 @@ const slug = computed(() => { | ||
| 21 | 13 | <summary> |
| 22 | 14 | <span v-if="open" class="i-iconoir-nav-arrow-down collapsible-icon" /> |
| 23 | 15 | <span v-else class="i-iconoir-nav-arrow-right collapsible-icon" /> |
| 24 | <h3 :id="slug" class="collapsible-title"> | |
| 25 | <a :href="`#${slug}`" class="header-anchor" aria-hidden="true"></a> | |
| 26 | {{ title || 'Details' }} | |
| 27 | </h3> | |
| 16 | {{ title || 'Details' }} | |
| 28 | 17 | </summary> |
| 29 | 18 | <slot /> |
| 30 | 19 | </details> |
| @@ -48,22 +37,4 @@ summary::-webkit-details-marker { | ||
| 48 | 37 | height: 1em; |
| 49 | 38 | flex-shrink: 0; |
| 50 | 39 | } |
| 51 | ||
| 52 | .collapsible-title { | |
| 53 | margin: 0; | |
| 54 | padding: 0; | |
| 55 | font-size: inherit; | |
| 56 | font-weight: inherit; | |
| 57 | line-height: inherit; | |
| 58 | color: inherit; | |
| 59 | letter-spacing: inherit; | |
| 60 | border: none; | |
| 61 | text-decoration: none; | |
| 62 | display: inline; | |
| 63 | } | |
| 64 | ||
| 65 | /* Hide the anchor icon VitePress would normally show on hover */ | |
| 66 | .collapsible-title .header-anchor { | |
| 67 | display: none; | |
| 68 | } | |
| 69 | 40 | </style> |
| \ No newline at end of file | ||
docs/websites.md +1 −1
| @@ -79,7 +79,7 @@ outline: 1 | ||
| 79 | 79 | |
| 80 | 80 | <Collapsible title="Misc"> |
| 81 | 81 | |
| 82 | ### Misc | |
| 82 | <h3 style="display:none" id="more">More</h3> | |
| 83 | 83 | |
| 84 | 84 | | Category | Websites | |
| 85 | 85 | | :--- | :--- | |