2024-07-28 06:29:05 +00:00
|
|
|
<script lang="ts" setup>
|
|
|
|
import { nextTick, onMounted, watch } from 'vue';
|
|
|
|
|
|
|
|
import mediumZoom from 'medium-zoom';
|
|
|
|
import { useRoute } from 'vitepress';
|
|
|
|
import DefaultTheme from 'vitepress/theme';
|
|
|
|
|
|
|
|
const { Layout } = DefaultTheme;
|
|
|
|
const route = useRoute();
|
|
|
|
|
|
|
|
const initZoom = () => {
|
|
|
|
// mediumZoom('[data-zoomable]', { background: 'var(--vp-c-bg)' });
|
|
|
|
mediumZoom('.VPContent img', { background: 'var(--vp-c-bg)' });
|
|
|
|
};
|
|
|
|
|
|
|
|
watch(
|
|
|
|
() => route.path,
|
|
|
|
() => nextTick(() => initZoom()),
|
|
|
|
);
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
initZoom();
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<Layout />
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<style>
|
2024-08-06 09:48:22 +00:00
|
|
|
.medium-zoom-overlay,
|
|
|
|
.medium-zoom-image--opened {
|
2024-07-28 06:29:05 +00:00
|
|
|
z-index: 2147483647;
|
|
|
|
}
|
|
|
|
</style>
|