File tree Expand file tree Collapse file tree 2 files changed +7
-12
lines changed Expand file tree Collapse file tree 2 files changed +7
-12
lines changed Original file line number Diff line number Diff line change 11<template >
2- <el-aside class =" md:flex bg-gray-800 text-white w-40 flex flex-col" :class = " { 'hidden': sidebarOpen} " >
2+ <el-aside class =" md:flex bg-gray-800 text-white w-40 flex flex-col" >
33 <div class =" p-4 text-xl font-bold" >使用者</div >
44 <el-menu
55 default-active =" 1"
1919
2020<script setup>
2121 defineProps ({
22- sidebarOpen: {
23- type: Boolean ,
24- default: true
25- },
2622 sidebarList: {
2723 type: Array ,
2824 default : () => []
Original file line number Diff line number Diff line change 11<template >
22 <main >
3- <el-container class =" h-screen" >
4- <Sidebar :sidebarOpen = " sidebarOpen" @singOut =" singOut" :sidebarList =" sidebarList" @getTableData =" getTableData" />
3+ <el-container class =" h-screen relative " >
4+ <Sidebar :class = " { 'hidden': sidebarOpen, 'z-50 fixed inset-y-0 left-0': !sidebarOpen} " @singOut =" singOut" :sidebarList =" sidebarList" @getTableData =" getTableData" />
55 <el-container >
6- <el-header class =" bg-white border-b flex items-center justify-between md:justify-end" >
7- <el-icon @click =" toggleSidebar" class =" text-black block md:hidden cursor-pointer" ><Menu /></el-icon >
8- <el-button type =" primary" class =" bg-gray-500 hover:bg-gray-600 border-gray-500 hover:border-gray-600" >新增</el-button >
6+ <el-header class =" bg-white border-b flex items-center justify-between md:justify-end" >
7+ <el-icon @click =" toggleSidebar" class =" text-black block md:hidden cursor-pointer" :class = " {'fixed left-32 z-50 text-white': !sidebarOpen} " ><Menu /></el-icon >
8+ <el-button type =" primary" :class = " {'fixed right-5' : !sidebarOpen} " class =" bg-gray-500 hover:bg-gray-600 border-gray-500 hover:border-gray-600" >新增</el-button >
99 </el-header >
1010
1111 <Table :tableData =" tableData" :tableHeader =" tableHeader" @openModal =" openModal" :tableTitle =" tableTitle" />
1717</template >
1818
1919<script setup>
20- import { ref , nextTick , onBeforeMount } from ' vue'
20+ import { ref , onBeforeMount } from ' vue'
2121 import { useRouter } from ' vue-router'
2222 import { Menu } from ' @element-plus/icons-vue'
2323 import { ElMessage } from ' element-plus'
3232 const sidebarOpen = ref (true )
3333 const toggleSidebar = async () => {
3434 sidebarOpen .value = ! sidebarOpen .value
35- // await nextTick()
3635 }
3736
3837 const sidebarList = ref ([])
You can’t perform that action at this time.
0 commit comments