1
0
Code Issues Pull Requests Packages Projects Releases Wiki Activity GitHub Gitee

样式优化与小调整

This commit is contained in:
2025-02-21 00:27:46 +08:00
parent 8820544319
commit 90860b719f
6 changed files with 31 additions and 23 deletions

View File

@@ -1,3 +1,11 @@
:root {
/* 左侧边栏加宽 */
--vp-sidebar-width: 320px;
/* 导航栏加高 */
--vp-nav-height: 72px;
}
.VPContent {
/* 首页与顶部之间的距离加高 */
padding-top: calc(var(--vp-nav-height) + 48px) !important;
}

View File

@@ -7,6 +7,9 @@
props.sidebarItem.base: {{ props.sidebarItem.base }}
<br>
-->
<!-- 跳过当前页面的菜单 -->
<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 }}
@@ -17,24 +20,21 @@
</p>
<!-- ------------------- -->
<!-- <pre>{{ page }}</pre> -->
<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"
:sidebar-item="item" />
</div>
</template>
</template>
<script setup lang="ts">
import { useData, useRouter, DefaultTheme } from 'vitepress';
import { useRouter, DefaultTheme } from 'vitepress';
const props = defineProps<{
base?: string,
sidebarItem: DefaultTheme.SidebarItem
}>()
const { page } = useData()
const router = useRouter()
function goTo(link: string) {

View File

@@ -9,11 +9,11 @@ hero:
src: /public/assets/logo.svg
alt: VitePress
style: "border-radius: 50%"
tagline: My great project tagline
tagline: 时间应该更重要的事情
actions:
- theme: brand
text: 进入教程
link: /how-to
link: /how-to/intro
- theme: alt
text: Markdown Examples
link: /markdown-examples

View File

@@ -7,7 +7,7 @@ export const nav: DefaultTheme.NavItem[] = [
},
{
text: 'Home2',
link: '/how-to/index',
link: '/how-to/intro',
activeMatch: '/how-to/',
},
{

View File

@@ -23,7 +23,7 @@ export const sidebar: DefaultTheme.Sidebar = {
items: [
{
text: '教程简介',
link: '/index.md',
link: 'intro',
},
]
},
@@ -35,7 +35,7 @@ export const sidebar: DefaultTheme.Sidebar = {
items: [
{
text: `${serial('linux.db')}MySQL 8.x 安装 & 配置 (Ubuntu)`,
link: 'database/mysql/install-on-ubuntu.md',
link: 'database/mysql/install-on-ubuntu',
}
]
},