From 54201aa0f03f5ab1b10ded3b80458db03512d3d4 Mon Sep 17 00:00:00 2001 From: Chuck1sn Date: Wed, 4 Jun 2025 11:49:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=A1=B5=E9=9D=A2=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E6=95=88=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/Assistant.vue | 4 +- frontend/src/components/Dashboard.vue | 22 ++++++-- frontend/src/components/Headbar.vue | 45 +++++++++-------- frontend/src/components/Sidebar.vue | 73 ++++++++++++++++++++++----- 4 files changed, 104 insertions(+), 40 deletions(-) diff --git a/frontend/src/components/Assistant.vue b/frontend/src/components/Assistant.vue index ee05d43..f42bca9 100644 --- a/frontend/src/components/Assistant.vue +++ b/frontend/src/components/Assistant.vue @@ -24,11 +24,11 @@ {{ commandContentMap[chatElement.command!] }} - - diff --git a/frontend/src/components/Dashboard.vue b/frontend/src/components/Dashboard.vue index a4c2416..50783b2 100644 --- a/frontend/src/components/Dashboard.vue +++ b/frontend/src/components/Dashboard.vue @@ -1,7 +1,6 @@ diff --git a/frontend/src/components/Headbar.vue b/frontend/src/components/Headbar.vue index 7f37c6f..b599c16 100644 --- a/frontend/src/components/Headbar.vue +++ b/frontend/src/components/Headbar.vue @@ -1,10 +1,9 @@ @@ -38,6 +43,31 @@ import SettingsIcon from "./icons/SettingsIcon.vue"; import UsersIcon from "./icons/UsersIcon.vue"; const isDrawerVisible = ref(false); +const emit = defineEmits(['menu-click']); + +// 菜单点击处理 +const handleMenuClick = () => { + emit('menu-click'); +}; + +const toggleSidebar = () => { + isDrawerVisible.value = !isDrawerVisible.value; +}; + +const openSidebar = () => { + isDrawerVisible.value = true; +}; + +const closeSidebar = () => { + isDrawerVisible.value = false; +}; + +defineExpose({ + toggleSidebar, + openSidebar, + closeSidebar, + isDrawerVisible +}); // 菜单配置 const menuItems = [ @@ -89,11 +119,28 @@ const isActive = (path: string) => { return route.path === path; }; -const closeSidebar = () => { - isDrawerVisible.value = false; -}; - onMounted(() => { initFlowbite(); }); + +