重构目录结构

This commit is contained in:
2025-09-22 17:20:24 +08:00
parent e0a3999a1a
commit a56d62fe16
30 changed files with 117 additions and 57 deletions

26
.vitepress/theme/index.ts Normal file
View File

@@ -0,0 +1,26 @@
import DefaultTheme from 'vitepress/theme'
import {useRoute} from 'vitepress'
import {watch, onMounted} from 'vue'
export default {
...DefaultTheme,
setup() {
const route = useRoute()
const updateNavVisibility = (path: string) => {
const navElement = document.querySelector('.VPNavBarMenu')
if (navElement instanceof HTMLElement) {
navElement.style.display = (path === '/' || path === '/docs/en/') ? 'none' : ''
}
}
onMounted(() => {
updateNavVisibility(route.path)
})
// 监听路由变化,处理导航栏显示
watch(() => route.path, (path) => {
updateNavVisibility(path)
})
}
}