From 8047987935e2bcdd03af72870c0b70322aab2ff9 Mon Sep 17 00:00:00 2001 From: alivender <13898766233@163.com> Date: Fri, 1 Aug 2025 13:40:21 +0800 Subject: [PATCH] =?UTF-8?q?Index=E7=95=8C=E9=9D=A2=E5=8F=AF=E4=BB=A5?= =?UTF-8?q?=E9=9A=90=E8=97=8FNavBar?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 39 +++++++++++++++++- src/views/Project/BottomBar.vue | 2 +- src/views/Project/Index.vue | 72 ++++++++++++++++++++++++++++++--- 3 files changed, 105 insertions(+), 8 deletions(-) diff --git a/src/App.vue b/src/App.vue index 9eacb1a..7d50002 100644 --- a/src/App.vue +++ b/src/App.vue @@ -12,6 +12,14 @@ const isDarkMode = ref( window.matchMedia("(prefers-color-scheme: dark)").matches, ); +// Navbar显示状态管理 +const showNavbar = ref(true); + +// 切换Navbar显示状态 +const toggleNavbar = () => { + showNavbar.value = !showNavbar.value; +}; + // 初始化主题设置 onMounted(() => { // 应用初始主题 @@ -47,6 +55,12 @@ provide("theme", { toggleTheme, }); +// 提供Navbar控制给子组件 +provide("navbar", { + showNavbar, + toggleNavbar, +}); + const currentRoutePath = computed(() => { return router.currentRoute.value.path; }); @@ -56,8 +70,8 @@ useAlertProvider();