样式优化与小调整
This commit is contained in:
@@ -1,3 +1,11 @@
|
|||||||
:root {
|
:root {
|
||||||
|
/* 左侧边栏加宽 */
|
||||||
--vp-sidebar-width: 320px;
|
--vp-sidebar-width: 320px;
|
||||||
|
/* 导航栏加高 */
|
||||||
|
--vp-nav-height: 72px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.VPContent {
|
||||||
|
/* 首页与顶部之间的距离加高 */
|
||||||
|
padding-top: calc(var(--vp-nav-height) + 48px) !important;
|
||||||
|
}
|
@@ -6,35 +6,35 @@
|
|||||||
<br>
|
<br>
|
||||||
props.sidebarItem.base: {{ props.sidebarItem.base }}
|
props.sidebarItem.base: {{ props.sidebarItem.base }}
|
||||||
<br>
|
<br>
|
||||||
-->
|
-->
|
||||||
<p v-if="props.sidebarItem.text">
|
|
||||||
<a v-if="props.sidebarItem.link" @click="goTo(props.sidebarItem.link)" style="cursor: pointer;">
|
|
||||||
{{ props.sidebarItem.text }}
|
|
||||||
</a>
|
|
||||||
<span style="font-weight: bold;" v-else>
|
|
||||||
{{ props.sidebarItem.text }}
|
|
||||||
</span>
|
|
||||||
</p>
|
|
||||||
<!-- ------------------- -->
|
|
||||||
|
|
||||||
<!-- <pre>{{ page }}</pre> -->
|
<!-- 跳过当前页面的菜单 -->
|
||||||
|
<template v-if="props.sidebarItem.text !== '开始'">
|
||||||
|
<p v-if="props.sidebarItem.text">
|
||||||
|
<a v-if="props.sidebarItem.link" @click="goTo(props.sidebarItem.link)" style="cursor: pointer;">
|
||||||
|
{{ props.sidebarItem.text }}
|
||||||
|
</a>
|
||||||
|
<span style="font-weight: bold;" v-else>
|
||||||
|
{{ props.sidebarItem.text }}
|
||||||
|
</span>
|
||||||
|
</p>
|
||||||
|
<!-- ------------------- -->
|
||||||
|
|
||||||
<div v-if="props.sidebarItem.items" :style="props.sidebarItem.text ? 'margin-left: 25px;' : undefined">
|
<div v-if="props.sidebarItem.items" :style="props.sidebarItem.text ? 'margin-left: 25px;' : undefined">
|
||||||
<contents v-for="item in props.sidebarItem.items" :base="props.sidebarItem.base || props.base"
|
<contents v-for="item in props.sidebarItem.items" :base="props.sidebarItem.base || props.base"
|
||||||
:sidebar-item="item" />
|
:sidebar-item="item" />
|
||||||
</div>
|
</div>
|
||||||
|
</template>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { useData, useRouter, DefaultTheme } from 'vitepress';
|
import { useRouter, DefaultTheme } from 'vitepress';
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
base?: string,
|
base?: string,
|
||||||
sidebarItem: DefaultTheme.SidebarItem
|
sidebarItem: DefaultTheme.SidebarItem
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
const { page } = useData()
|
|
||||||
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
|
|
||||||
function goTo(link: string) {
|
function goTo(link: string) {
|
||||||
|
@@ -9,11 +9,11 @@ hero:
|
|||||||
src: /public/assets/logo.svg
|
src: /public/assets/logo.svg
|
||||||
alt: VitePress
|
alt: VitePress
|
||||||
style: "border-radius: 50%"
|
style: "border-radius: 50%"
|
||||||
tagline: My great project tagline
|
tagline: 时间应该更重要的事情
|
||||||
actions:
|
actions:
|
||||||
- theme: brand
|
- theme: brand
|
||||||
text: 进入教程
|
text: 进入教程
|
||||||
link: /how-to
|
link: /how-to/intro
|
||||||
- theme: alt
|
- theme: alt
|
||||||
text: Markdown Examples
|
text: Markdown Examples
|
||||||
link: /markdown-examples
|
link: /markdown-examples
|
||||||
|
@@ -7,7 +7,7 @@ export const nav: DefaultTheme.NavItem[] = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: 'Home2',
|
text: 'Home2',
|
||||||
link: '/how-to/index',
|
link: '/how-to/intro',
|
||||||
activeMatch: '/how-to/',
|
activeMatch: '/how-to/',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@@ -23,7 +23,7 @@ export const sidebar: DefaultTheme.Sidebar = {
|
|||||||
items: [
|
items: [
|
||||||
{
|
{
|
||||||
text: '教程简介',
|
text: '教程简介',
|
||||||
link: '/index.md',
|
link: 'intro',
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -35,7 +35,7 @@ export const sidebar: DefaultTheme.Sidebar = {
|
|||||||
items: [
|
items: [
|
||||||
{
|
{
|
||||||
text: `${serial('linux.db')}MySQL 8.x 安装 & 配置 (Ubuntu)`,
|
text: `${serial('linux.db')}MySQL 8.x 安装 & 配置 (Ubuntu)`,
|
||||||
link: 'database/mysql/install-on-ubuntu.md',
|
link: 'database/mysql/install-on-ubuntu',
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user