fix nuxt ui 参数传递错误

This commit is contained in:
2025-07-26 00:02:37 +08:00
parent e6e27c8ccf
commit 9264107b3c
2 changed files with 5 additions and 21 deletions

View File

@@ -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>