feat:更新博客
This commit is contained in:
@@ -1,12 +1,29 @@
|
||||
import DefaultTheme from 'vitepress/theme'
|
||||
import Confetti from "./components/Confetti.vue";
|
||||
import type { EnhanceAppContext } from 'vitepress'
|
||||
|
||||
import { onMounted, watch, nextTick } from 'vue'
|
||||
import { useRoute } from 'vitepress'
|
||||
import mediumZoom from 'medium-zoom'
|
||||
import '../theme/style.css'
|
||||
import './style/var.css'
|
||||
import './style/vp-code.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())
|
||||
)
|
||||
},
|
||||
enhanceApp({ app }: EnhanceAppContext) {
|
||||
app.component("Confetti", Confetti);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user