chore: 初始化仓库,导入项目基线代码
Academy v0.8.3 完整代码基线:Go 后端(internal/cmd/cli/mcp-server/docreader)、 Vue 前端(frontend)、数据库迁移(migrations)、部署编排(docker/helm/deploy)与文档。 今日开发的培训推送管理改动随后单独提交。
This commit is contained in:
commit
7ec21f35b0
5767 files changed
+1436788
No files matched your search
@@ -0,0 +1,32 @@
|
||||
<script setup lang="ts">
|
||||
import { nextTick, onMounted, ref, watch } from 'vue'
|
||||
import { useData } from 'vitepress'
|
||||
|
||||
const { page } = useData()
|
||||
const label = ref<HTMLElement>()
|
||||
|
||||
async function revealCurrentPage() {
|
||||
// Wait for VitePress to mark the current link and expand its section.
|
||||
await nextTick()
|
||||
const sidebar = label.value?.closest<HTMLElement>('.VPSidebar')
|
||||
const active = sidebar?.querySelector<HTMLElement>('.VPSidebarItem.is-active > .item > a')
|
||||
if (!sidebar || !active) return
|
||||
|
||||
const bounds = sidebar.getBoundingClientRect()
|
||||
const item = active.getBoundingClientRect()
|
||||
const curtain = sidebar.querySelector<HTMLElement>('.curtain')?.getBoundingClientRect()
|
||||
const top = Math.max(bounds.top, curtain?.bottom ?? bounds.top) + 16
|
||||
const bottom = bounds.bottom - 16
|
||||
if (item.top >= top && item.bottom <= bottom) return
|
||||
|
||||
// Move only the sidebar; scrollIntoView could also move the document body.
|
||||
sidebar.scrollTop += item.top - (top + (bottom - top - item.height) / 2)
|
||||
}
|
||||
|
||||
onMounted(revealCurrentPage)
|
||||
watch(() => page.value.relativePath, revealCurrentPage, { flush: 'post' })
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<p ref="label" class="wk-docs-label">使用文档</p>
|
||||
</template>
|
||||
Reference in new issue
Block a user