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(); }); + +