mirror of
https://github.com/NanmiCoder/cc-haha
synced 2026-07-17 13:13:35 +08:00
21 lines
490 B
TypeScript
21 lines
490 B
TypeScript
import DefaultTheme from 'vitepress/theme'
|
|
import mediumZoom from 'medium-zoom'
|
|
import { onMounted, watch, nextTick } from 'vue'
|
|
import { useRoute } from 'vitepress'
|
|
import './custom.css'
|
|
|
|
export default {
|
|
extends: DefaultTheme,
|
|
setup() {
|
|
const route = useRoute()
|
|
const initZoom = () => {
|
|
mediumZoom('.main img', { background: 'var(--vp-c-bg)' })
|
|
}
|
|
onMounted(() => initZoom())
|
|
watch(
|
|
() => route.path,
|
|
() => nextTick(() => initZoom())
|
|
)
|
|
},
|
|
}
|