包含 VitePress 文档站完整源码及全新自定义首页设计: - 自定义首页组件 (Home.vue):Hero + 终端动效 + 核心能力 + 架构展示 + 快速开始 + CTA - 自定义 Layout.vue:首页/文档页布局切换 - 金铜色品牌主题样式 - 完整文档页面(指南、API、更新日志、演示、社区) - SEO 配置(sitemap、robots、meta 标签)
28 lines
670 B
Vue
28 lines
670 B
Vue
<script setup>
|
|
import DefaultTheme from 'vitepress/theme'
|
|
import { useRoute } from 'vitepress'
|
|
import { computed, onMounted, onUnmounted } from 'vue'
|
|
import Home from './Home.vue'
|
|
|
|
const route = useRoute()
|
|
const isHome = computed(() => route.path === '/' || route.path === '/index.html')
|
|
|
|
function applyLayout() {
|
|
if (isHome.value) {
|
|
document.documentElement.classList.add('home-layout')
|
|
} else {
|
|
document.documentElement.classList.remove('home-layout')
|
|
}
|
|
}
|
|
|
|
onMounted(applyLayout)
|
|
onUnmounted(() => {
|
|
document.documentElement.classList.remove('home-layout')
|
|
})
|
|
</script>
|
|
|
|
<template>
|
|
<Home v-if="isHome" />
|
|
<DefaultTheme.Layout v-else />
|
|
</template>
|