修改导航栏
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<aside
|
||||
class="w-64 bg-gradient-to-b from-gray-50 to-gray-100 dark:from-gray-800 dark:to-gray-900 flex flex-col h-screen"
|
||||
class="w-64 bg-white dark:bg-gray-900 flex flex-col h-screen border-r border-gray-200 dark:border-gray-700"
|
||||
>
|
||||
<!-- Logo -->
|
||||
<div
|
||||
@@ -20,57 +20,82 @@
|
||||
<TemplateMenu />
|
||||
</NuxtLink>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- Search Box -->
|
||||
<div class="p-4">
|
||||
<div class="p-4 border-gray-200 dark:border-gray-700">
|
||||
<ClientOnly>
|
||||
<UContentSearchButton
|
||||
v-if="header?.search"
|
||||
:collapsed="false"
|
||||
loading="true"
|
||||
label="搜索文档"
|
||||
description="请输入关键词"
|
||||
class="w-full dark:bg-gray-700 text-gray-600 dark:text-gray-100"
|
||||
color="primary"
|
||||
/>
|
||||
<UContentSearchButton
|
||||
v-if="header?.search"
|
||||
:collapsed="false"
|
||||
loading="true"
|
||||
label="搜索文档"
|
||||
description="请输入关键词"
|
||||
class="w-full"
|
||||
color="primary"
|
||||
/>
|
||||
</ClientOnly>
|
||||
</div>
|
||||
|
||||
<!-- 可滚动的导航区域 -->
|
||||
<div
|
||||
class="flex-1 overflow-y-auto scrollbar-thin scrollbar-thumb-gray-300 dark:scrollbar-thumb-gray-600 scrollbar-track-transparent hover:scrollbar-thumb-gray-400 dark:hover:scrollbar-thumb-gray-500 p-4"
|
||||
style="max-height: calc(100vh - 180px)"
|
||||
class="flex-1 overflow-y-auto scrollbar-thin scrollbar-thumb-gray-300 dark:scrollbar-thumb-gray-600 scrollbar-track-transparent hover:scrollbar-thumb-gray-400 dark:hover:scrollbar-thumb-gray-500"
|
||||
style="max-height: calc(100vh - 200px)"
|
||||
>
|
||||
<nav class="space-y-6">
|
||||
|
||||
<!-- 导航 Section -->
|
||||
<div>
|
||||
<h3
|
||||
class="text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wider mb-3 px-1"
|
||||
>
|
||||
导航
|
||||
</h3>
|
||||
<div class="space-y-2">
|
||||
|
||||
<div>
|
||||
<NuxtLink
|
||||
to="/"
|
||||
class="flex items-center px-4 py-3 text-sm font-medium rounded-xl text-gray-700 dark:text-gray-300 hover:bg-white dark:hover:bg-gray-700 hover:shadow-sm transition-all duration-200"
|
||||
class="flex items-center px-4 py-3 text-sm font-medium rounded-xl text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-800 hover:shadow-sm transition-all duration-200"
|
||||
:class="{
|
||||
'bg-white dark:bg-gray-700 text-blue-600 dark:text-blue-400 shadow-sm':
|
||||
'bg-blue-50 dark:bg-blue-900/20 text-blue-600 dark:text-blue-400 shadow-sm':
|
||||
$route.path === '/',
|
||||
}"
|
||||
>
|
||||
<Icon name="uim:house-user" class="text-primary mr-1" size="20" />
|
||||
<Icon name="uim:house-user" class="text-primary mr-2" size="20" />
|
||||
站点首页
|
||||
</NuxtLink>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- 分隔线 -->
|
||||
<div class="flex items-center px-6 p-1 ">
|
||||
<ContentDirectory />
|
||||
</div>
|
||||
<ContentDirectory />
|
||||
<!-- Document Navigation -->
|
||||
<UContainer>
|
||||
<UPageAside>
|
||||
<UContentNavigation highlight :navigation="navigation" />
|
||||
</UPageAside>
|
||||
</UContainer>
|
||||
</nav>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- root: 'space-y-1',
|
||||
list: 'space-y-1',
|
||||
item: '',
|
||||
listWithChildren: 'ms-4 border-s border-gray-200 dark:border-gray-700',
|
||||
itemWithChildren: 'flex flex-col',
|
||||
trigger: 'font-medium text-sm',
|
||||
link: 'group relative w-full px-4 py-3 text-sm font-medium rounded-xl text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-800 hover:shadow-sm transition-all duration-200 flex items-center gap-2',
|
||||
linkLeadingIcon: 'shrink-0 size-5',
|
||||
linkTrailingIcon: 'size-4 transform transition-transform duration-200 shrink-0 group-data-[state=open]:rotate-180',
|
||||
linkTitle: 'truncate'
|
||||
-->
|
||||
<!-- 分隔线 -->
|
||||
|
||||
<!-- Document Navigation -->
|
||||
<UContainer>
|
||||
<UPageAside>
|
||||
<UContentNavigation
|
||||
highlight
|
||||
:navigation="navigation"
|
||||
color="primary"
|
||||
variant="pill"
|
||||
:ui="{
|
||||
}"
|
||||
/>
|
||||
</UPageAside>
|
||||
</UContainer>
|
||||
|
||||
|
||||
</div>
|
||||
</aside>
|
||||
</template>
|
||||
|
Reference in New Issue
Block a user