| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147 |
- <script setup>
- import { Setting } from "@element-plus/icons-vue";
- const handleOpen = (key, keyPath) => {
- console.log(key, keyPath);
- };
- const handleClose = (key, keyPath) => {
- console.log(key, keyPath);
- };
- </script>
- <template>
- <el-container class="app-layout">
- <el-aside width="200px" class="app-side">
- <div class="logo">
- <span>ADMIN UI</span>
- </div>
- <el-menu default-active="/home" class="side-menu" @open="handleOpen" @close="handleClose" router>
- <el-menu-item index="/home">
- <el-icon>
- <HomeFilled />
- </el-icon>
- <span>⾸⻚</span>
- </el-menu-item>
- <el-sub-menu index="/system">
- <template #title>
- <el-icon>
- <setting />
- </el-icon>
- <span>系统管理</span>
- </template>
- <el-menu-item index="/system/user">
- <el-icon>
- <Menu />
- </el-icon>
- <span>⽤户管理</span>
- </el-menu-item>
- <el-menu-item index="/system/role">
- <el-icon>
- <Menu />
- </el-icon>
- <span>⻆⾊管理</span>
- </el-menu-item>
- <el-menu-item index="/system/permission">
- <el-icon>
- <Menu />
- </el-icon>
- <span>权限管理</span>
- </el-menu-item>
- </el-sub-menu>
- </el-menu>
- </el-aside>
- <el-container class="app-cent-container">
- <el-header class="app-header">Header</el-header>
- <el-main class="app-content">
- <div class="content-wrapper">
- <router-view></router-view>
- </div>
- </el-main>
- </el-container>
- </el-container>
- </template>
- <style lang="less" scoped>
- .app-layout {
- height: 100vh;
- background-color: #f0f2f5;
- .app-side {
- background-color: #fff;
- box-shadow: 2px 0 8px 0 rgba(29, 35, 41, 0.05);
- position: relative;
- z-index: 10;
- .logo {
- height: 64px;
- display: flex;
- align-items: center;
- justify-content: center;
- padding: 0 24px;
- overflow: hidden;
- span {
- color: #0c0c0c;
- font-size: 18px;
- font-weight: 600;
- white-space: nowrap;
- }
- }
- .side-menu {
- border-right: none;
- }
- }
- .app-cent-container {
- position: fixed;
- top: 0;
- left: 200px;
- right: 0;
- bottom: 0;
- background-color: #f9f9f9;
- .app-header {
- display: flex;
- flex-direction: row;
- justify-content: space-between;
- height: 64px;
- background: #fff;
- padding-left: 16px;
- padding-right: 16px;
- line-height: 64px;
- align-items: center;
- border-bottom: 1px solid #d8dce5;
- }
- .app-content {
- display: flex;
- flex-direction: column;
- position: absolute;
- top: 104px;
- right: 20px;
- bottom: 20px;
- left: 20px;
- background-color: #fff;
- }
- }
- .app-footer {
- text-align: center;
- padding: 16px 24px;
- color: rgba(0, 0, 0, 0.45);
- font-size: 14px;
- background: #fff;
- .footer-links {
- margin-bottom: 8px;
- a {
- color: rgba(0, 0, 0, 0.45);
- margin: 0 8px;
- &:hover {
- color: rgba(0, 0, 0, 0.65);
- }
- }
- }
- }
- }
- </style>
|