fix nuxt ui 参数传递错误
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<aside
|
||||
<div
|
||||
class="w-64 bg-white dark:bg-gray-900 flex flex-col h-screen border-r border-gray-200 dark:border-gray-700 overflow-hidden">
|
||||
<!-- Logo -->
|
||||
<div class="flex-shrink-0 p-4 border-gray-200 dark:border-gray-700">
|
||||
@@ -18,7 +18,7 @@
|
||||
<!-- Search Box -->
|
||||
<div class="p-4 border-gray-200 dark:border-gray-700">
|
||||
<ClientOnly>
|
||||
<UContentSearchButton :collapsed="false" loading="true" label="搜索文档" description="请输入关键词" class="w-full"
|
||||
<UContentSearchButton :collapsed="false" label="搜索文档" class="w-full"
|
||||
color="primary" />
|
||||
</ClientOnly>
|
||||
</div>
|
||||
@@ -50,8 +50,6 @@
|
||||
|
||||
<!-- 文档目录导航 -->
|
||||
<div class="mt-6 flex items-center justify-start pl-8 w-4/5">
|
||||
|
||||
<NuxtLink>
|
||||
<UContentNavigation highlight :navigation="navigation" color="primary" type="single" variant="pill" :ui="{
|
||||
root: '',
|
||||
content: '',
|
||||
@@ -69,12 +67,9 @@
|
||||
linkTitle: '',
|
||||
linkTitleExternalIcon: 'size- align-top text-dimmed'
|
||||
}" />
|
||||
</NuxtLink>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</aside>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
|
@@ -23,11 +23,11 @@
|
||||
/>
|
||||
|
||||
<!-- Main Content -->
|
||||
<main class="flex-1 overflow-y-auto pt-16">
|
||||
<UMain class="flex-1 overflow-y-auto">
|
||||
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-6">
|
||||
<slot />
|
||||
</div>
|
||||
</main>
|
||||
</UMain>
|
||||
|
||||
<!-- Footer -->
|
||||
<AppFooter />
|
||||
@@ -47,16 +47,5 @@ const toggleSidebar = () => {
|
||||
isSidebarOpen.value = !isSidebarOpen.value
|
||||
}
|
||||
|
||||
// 监听路由变化,在移动端自动关闭侧边栏
|
||||
const route = useRoute()
|
||||
const stopWatch = watch(() => route.path, () => {
|
||||
if (isSidebarOpen.value) {
|
||||
isSidebarOpen.value = false
|
||||
}
|
||||
})
|
||||
|
||||
// 组件卸载时清理监听器
|
||||
onUnmounted(() => {
|
||||
stopWatch()
|
||||
})
|
||||
</script>
|
Reference in New Issue
Block a user