mirror of
https://github.com/ZiuChen/ZiuChen.github.io.git
synced 2025-08-17 23:19:55 +08:00
fix: 修复window not defined导致的构建错误
This commit is contained in:
parent
4ed9f088a8
commit
517c747226
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,3 +1,4 @@
|
||||
node_modules
|
||||
dist
|
||||
cache
|
||||
cache
|
||||
.temp
|
@ -1,6 +1,6 @@
|
||||
import DefaultTheme from 'vitepress/theme'
|
||||
import { onMounted, watch, nextTick, watchEffect } from 'vue'
|
||||
import { useRouter } from 'vitepress'
|
||||
import { inBrowser, useRouter } from 'vitepress'
|
||||
import mediumZoom from 'medium-zoom'
|
||||
import Title from '../components/Title.vue'
|
||||
import './index.css'
|
||||
@ -17,7 +17,7 @@ export default {
|
||||
watchEffect(() => {
|
||||
// 将router.route.path作为依赖收集 首次访问即添加监听
|
||||
const path = router.route.path
|
||||
nextTick(() => mediumZoom('.main img', { background: 'var(--vp-c-bg)' }))
|
||||
nextTick(() => (inBrowser ? mediumZoom('.main img', { background: 'var(--vp-c-bg)' }) : null))
|
||||
})
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user