优化页面显示效果

This commit is contained in:
Chuck1sn
2025-06-04 11:49:47 +08:00
parent 07e590dc2d
commit 54201aa0f0
4 changed files with 104 additions and 40 deletions

View File

@@ -1,7 +1,6 @@
<template>
<Headbar :changeAssistantVisible="changeAssistantVisible"></Headbar>
<Sidebar>
</Sidebar>
<Headbar :changeAssistantVisible="changeAssistantVisible" :onSidebarToggle="toggleSidebar"></Headbar>
<Sidebar ref="sidebarRef" @menu-click="handleMenuClick"></Sidebar>
<div class="flex flex-row h-[calc(100vh-3.5rem)] mt-14">
<article class="flex-1 sm:ml-44 overflow-y-auto">
<RouterView></RouterView>
@@ -12,15 +11,28 @@
</template>
<script setup lang="ts">
import { ref } from "vue";
import { RouterView } from "vue-router";
import Assistant from "./Assistant.vue";
import Headbar from "./Headbar.vue";
import Sidebar from "./Sidebar.vue";
import Assistant from "./Assistant.vue";
import { ref } from "vue";
const isAssistantVisible = ref(false);
const sidebarRef = ref();
const changeAssistantVisible = () => {
isAssistantVisible.value = !isAssistantVisible.value;
};
const toggleSidebar = () => {
if (sidebarRef.value) {
sidebarRef.value.toggleSidebar();
}
};
const handleMenuClick = () => {
if (sidebarRef.value) {
sidebarRef.value.closeSidebar();
}
};
</script>