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 @@
11<script setup lang="ts">
2import { computed } from 'vue'
2import { computed, inject, nextTick, watch } from 'vue'
3import { mediumZoomSymbol } from '../../composables/medium-zoom'
34import { useIsPrint } from './composables'
45import { useTabsRenderAll, useTabsSingleState } from './state'
56
@@ -16,6 +17,14 @@ const renderAll = useTabsRenderAll()
1617const isActive = computed(() =>
1718 selected.value === props.label || Boolean(isPrint.value) || renderAll
1819)
20
21const zoom = inject(mediumZoomSymbol)
22watch(isActive, async (active) => {
23 if (active) {
24 await nextTick()
25 zoom?.refresh()
26 }
27})
1928const panelId = computed(() => `panel-${props.anchor}-${uid}`)
2029const buttonId = computed(() => `tab-${props.anchor}-${uid}`)
2130</script>