109 lines
2.5 KiB
Vue
109 lines
2.5 KiB
Vue
<template>
|
|
<SiteLoading v-if="!home" hint="正在读取内容" />
|
|
<SiteHome v-else :home="home" :logo-url="logoUrl">
|
|
<p class="crumb">首页 / {{ crumb }}</p>
|
|
<div class="layout">
|
|
<nav class="side-nav" aria-label="继续教育子导航">
|
|
<NuxtLink
|
|
v-for="section in EDU_SECTIONS"
|
|
:key="section.key"
|
|
:to="section.path"
|
|
:aria-current="section.key === activeKey ? 'page' : undefined"
|
|
>{{ section.label }}</NuxtLink>
|
|
</nav>
|
|
<div class="main-panel">
|
|
<NuxtPage />
|
|
</div>
|
|
</div>
|
|
</SiteHome>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import { EDU_SECTIONS } from "~/composables/useEduNav"
|
|
|
|
definePageMeta({ layout: false })
|
|
|
|
const route = useRoute()
|
|
const { home, logoUrl, ensureChrome } = useSiteChrome()
|
|
|
|
const activeKey = computed(() => {
|
|
const path = route.path
|
|
if (path.startsWith("/edu/notices")) return "notices"
|
|
return "platforms"
|
|
})
|
|
|
|
const crumb = computed(() => {
|
|
const section = EDU_SECTIONS.find((item) => item.key === activeKey.value)
|
|
return `继续教育 / ${section?.label || "在线教育"}`
|
|
})
|
|
|
|
await ensureChrome()
|
|
</script>
|
|
|
|
<style scoped>
|
|
.crumb {
|
|
margin: 28px 0 16px;
|
|
font-size: 13px;
|
|
color: var(--muted, #5b6b85);
|
|
}
|
|
.layout {
|
|
display: grid;
|
|
grid-template-columns: 220px minmax(0, 1fr);
|
|
gap: 20px;
|
|
margin: 0 0 40px;
|
|
}
|
|
.side-nav {
|
|
align-self: start;
|
|
padding: 12px 0;
|
|
background: var(--surface, #fff);
|
|
border: 1px solid var(--line, #d6e4ff);
|
|
border-radius: 14px;
|
|
}
|
|
.side-nav a {
|
|
display: block;
|
|
padding: 10px 16px;
|
|
font-size: 14px;
|
|
color: var(--muted, #5b6b85);
|
|
border-left: 3px solid transparent;
|
|
text-decoration: none;
|
|
}
|
|
.side-nav a[aria-current="page"] {
|
|
color: var(--c, #1677ff);
|
|
font-weight: 600;
|
|
background: var(--chip, #f7faff);
|
|
border-left-color: var(--c, #1677ff);
|
|
}
|
|
.main-panel {
|
|
background: var(--surface, #fff);
|
|
border: 1px solid var(--line, #d6e4ff);
|
|
border-radius: 14px;
|
|
padding: 22px 24px 28px;
|
|
min-height: 320px;
|
|
}
|
|
@media (max-width: 860px) {
|
|
.layout {
|
|
grid-template-columns: 1fr;
|
|
}
|
|
.side-nav {
|
|
display: flex;
|
|
flex-wrap: nowrap;
|
|
gap: 0;
|
|
padding: 0;
|
|
overflow-x: auto;
|
|
-webkit-overflow-scrolling: touch;
|
|
overscroll-behavior-x: contain;
|
|
scrollbar-width: thin;
|
|
}
|
|
.side-nav a {
|
|
flex: none;
|
|
white-space: nowrap;
|
|
border-left: 0;
|
|
border-bottom: 2px solid transparent;
|
|
}
|
|
.side-nav a[aria-current="page"] {
|
|
border-bottom-color: var(--c, #1677ff);
|
|
background: transparent;
|
|
}
|
|
}
|
|
</style>
|