Skip to content

Commit

Permalink
Update MyLayout.vue
Browse files Browse the repository at this point in the history
  • Loading branch information
KadDarem committed Jun 21, 2024
1 parent 8d93da4 commit 8569e9d
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions docs/.vitepress/theme/MyLayout.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<script setup>
import DefaultTheme from 'vitepress/theme'
import { onContentUpdated, useRoute } from 'vitepress'
import { computed, ref, onMounted } from "vue";
import { useRoute, useRouter } from 'vitepress'
import { computed, watch, onMounted, nextTick } from "vue";
import { useSidebar } from 'vitepress/theme'
import mediumZoom from 'medium-zoom/dist/pure'
import mediumZoom from 'medium-zoom/dist/pure/medium-zoom.umd.js'
const route = useRoute()
const { sidebar } = useSidebar()
Expand Down Expand Up @@ -55,7 +55,23 @@
onMounted(() => {
mediumZoom('[data-zoomable]', { background: 'var(--zoom-bg)' });
})
let a = computed(() => {
console.log('a')
return Math.random()
})
const initZoom = () => {
mediumZoom('[data-zoomable]', { background: 'var(--zoom-bg)' });
};
onMounted(() => {
initZoom();
});
watch(
() => route.path,
() => nextTick(() => initZoom())
);
</script>

<template>
Expand Down

0 comments on commit 8569e9d

Please sign in to comment.