Commit f63a4629b3
Unsigned
Layout: unified · split
docs/.vitepress/theme/components/tabs/PluginTabsTab.vue +10 −1
| @@ -1,5 +1,6 @@ | |||
| 1 | <script setup lang="ts"> | 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 | import { useIsPrint } from './composables' | 4 | import { useIsPrint } from './composables' |
| 4 | import { useTabsRenderAll, useTabsSingleState } from './state' | 5 | import { useTabsRenderAll, useTabsSingleState } from './state' |
| 5 | 6 | ||
| @@ -16,6 +17,14 @@ const renderAll = useTabsRenderAll() | |||
| 16 | const isActive = computed(() => | 17 | const isActive = computed(() => |
| 17 | selected.value === props.label || Boolean(isPrint.value) || renderAll | 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 | const panelId = computed(() => `panel-${props.anchor}-${uid}`) | 28 | const panelId = computed(() => `panel-${props.anchor}-${uid}`) |
| 20 | const buttonId = computed(() => `tab-${props.anchor}-${uid}`) | 29 | const buttonId = computed(() => `tab-${props.anchor}-${uid}`) |
| 21 | </script> | 30 | </script> |