Files
gsfdc/portal/app/components/about/AboutShell.vue
T

115 lines
2.5 KiB
Vue

<template>
<SiteLoading v-if="!ready" hint="正在读取内容" />
<SiteHome v-else-if="home" :home="home" :logo-url="logoUrl">
<p class="crumb">首页 / {{ crumb }}</p>
<div class="layout" :class="{ 'no-side': !showSide }">
<nav v-if="showSide" class="side-nav" aria-label="组织概况子导航">
<NuxtLink
v-for="section in ABOUT_SECTIONS"
:key="section.key"
:to="section.path"
:aria-current="section.key === activeKey ? 'page' : undefined"
>{{ section.label }}</NuxtLink>
</nav>
<div class="main-panel">
<slot />
</div>
</div>
</SiteHome>
</template>
<script setup lang="ts">
import { ABOUT_SECTIONS } from "~/composables/useAboutNav"
withDefaults(
defineProps<{
home: any
logoUrl: string
ready: boolean
crumb: string
activeKey?: string
showSide?: boolean
}>(),
{ showSide: true },
)
</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;
}
.layout.no-side {
grid-template-columns: 1fr;
}
.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;
}
.placeholder {
margin: 0;
padding: 48px 20px;
text-align: center;
color: var(--muted, #5b6b85);
font-size: 15px;
letter-spacing: 0.06em;
border: 1px dashed var(--line, #d6e4ff);
}
@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>