Commit f63a4629b3
Unsigned
Layout: unified · split
docs/.vitepress/theme/components/tabs/PluginTabsTab.vue +10 −1
| @@ -1,5 +1,6 @@ | ||
| 1 | 1 | <script setup lang="ts"> |
| 2 | import { computed } from 'vue' | |
| 2 | import { computed, inject, nextTick, watch } from 'vue' | |
| 3 | import { mediumZoomSymbol } from '../../composables/medium-zoom' | |
| 3 | 4 | import { useIsPrint } from './composables' |
| 4 | 5 | import { useTabsRenderAll, useTabsSingleState } from './state' |
| 5 | 6 | |
| @@ -16,6 +17,14 @@ const renderAll = useTabsRenderAll() | ||
| 16 | 17 | const isActive = computed(() => |
| 17 | 18 | selected.value === props.label || Boolean(isPrint.value) || renderAll |
| 18 | 19 | ) |
| 20 | ||
| 21 | const zoom = inject(mediumZoomSymbol) | |
| 22 | watch(isActive, async (active) => { | |
| 23 | if (active) { | |
| 24 | await nextTick() | |
| 25 | zoom?.refresh() | |
| 26 | } | |
| 27 | }) | |
| 19 | 28 | const panelId = computed(() => `panel-${props.anchor}-${uid}`) |
| 20 | 29 | const buttonId = computed(() => `tab-${props.anchor}-${uid}`) |
| 21 | 30 | </script> |