Commit f63a4629b3

f63a4629b33a0d3aacdc9678c7f7b49bb8236dbb

parent: 0c1dad3246

Unsigned

Duck <57977673+woducku@users.noreply.github.com> · 2026-06-21 13:42 UTC

image zoom fix for tabs

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">
2import { computed } from 'vue' 2import { computed, inject, nextTick, watch } from 'vue'
3import { mediumZoomSymbol } from '../../composables/medium-zoom'
3import { useIsPrint } from './composables' 4import { useIsPrint } from './composables'
4import { useTabsRenderAll, useTabsSingleState } from './state' 5import { useTabsRenderAll, useTabsSingleState } from './state'
5 6
@@ -16,6 +17,14 @@ const renderAll = useTabsRenderAll()
16const isActive = computed(() => 17const isActive = computed(() =>
17 selected.value === props.label || Boolean(isPrint.value) || renderAll 18 selected.value === props.label || Boolean(isPrint.value) || renderAll
18) 19)
20
21const zoom = inject(mediumZoomSymbol)
22watch(isActive, async (active) => {
23 if (active) {
24 await nextTick()
25 zoom?.refresh()
26 }
27})
19const panelId = computed(() => `panel-${props.anchor}-${uid}`) 28const panelId = computed(() => `panel-${props.anchor}-${uid}`)
20const buttonId = computed(() => `tab-${props.anchor}-${uid}`) 29const buttonId = computed(() => `tab-${props.anchor}-${uid}`)
21</script> 30</script>