mirror of
https://github.com/ccmjga/zhilu-admin
synced 2026-03-25 21:03:43 +08:00
重构组件结构,优化导入路径并移除不必要的组件,新增多个模态框组件以支持部门、角色、权限和用户管理功能
This commit is contained in:
38
frontend/src/components/layout/Dashboard.vue
Normal file
38
frontend/src/components/layout/Dashboard.vue
Normal file
@@ -0,0 +1,38 @@
|
||||
<template>
|
||||
<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>
|
||||
</article>
|
||||
<Assistant v-if="isAssistantVisible"></Assistant>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
import { RouterView } from "vue-router";
|
||||
import Assistant from "@/components/common/Assistant.vue";
|
||||
import Headbar from "./Headbar.vue";
|
||||
import Sidebar from "./Sidebar.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>
|
||||
Reference in New Issue
Block a user