feat: add img zoom

This commit is contained in:
camera-2018
2024-02-20 00:13:19 +08:00
parent 3da6a88596
commit 25e0d24dfa
10 changed files with 71 additions and 8 deletions

View File

@@ -1,5 +1,6 @@
// https://vitepress.dev/guide/custom-theme
import { h, watch } from 'vue'
import { watch } from 'vue'
import { createMediumZoomProvider } from './useMediumZoom'
// import Theme from 'vitepress/theme'
import DefaultTheme from 'vitepress/theme-without-fonts'
import Layout from './Layout.vue'
@@ -14,6 +15,7 @@ let homePageStyle = undefined
export default {
...DefaultTheme,
Layout: Layout,
enhanceApp(ctx) {
DefaultTheme.enhanceApp(ctx)
ctx.app.component('Download', Download)
@@ -21,12 +23,12 @@ export default {
ctx.app.component('Parallax', Parallax)
if (typeof window === 'undefined')
return
watch(
() => ctx.router.route.data.relativePath,
() => updateHomePageStyle(location.pathname === '/' || location.pathname === '/contributors'),
{ immediate: true },
)
createMediumZoomProvider(ctx.app, ctx.router)
},
}