一个基于Vue3和ElementPlus的后台管理布局

在App.vue的文件可以直接粘贴使用,注意:在此之前要删除vue脚手架自带的CSS全局样式文件,vue3图标的使用在main.js文件中进行全局注册。

<template>
    <div class="layout">
        <el-container  class="container">
            <el-aside class="aside">
                <div class="head">
                    <div>
                        <img src="//s.weituibao.com/1582958061265/mlogo.png" alt="logo">
                        <span>vue3</span>
                    </div>
                </div>
                <div class="line" />
                <el-menu
                        background-color="#222832"
                        text-color="#fff"
                        :router="true"

                >
                    <el-menu-item index="/introduce"><el-icon><House /></el-icon>首页</el-menu-item>
                    <el-sub-menu index="1">
                        <template #title>
                            <span>模块信息管理</span>
                        </template>
                        <el-menu-item-group>
                            <el-menu-item index="/dashboard"><el-icon><Odometer /></el-icon>模块信息管理</el-menu-item>
                        </el-menu-item-group>
                    </el-sub-menu>


                </el-menu>
            </el-aside>
            <el-container class="content">
                <div class="header">
                    <div class="left">

                    </div>
                    <div class="right">
                        <el-popover
                                placement="bottom"
                                :width="320"
                                trigger="click"
                                popper-class="popper-user-box"
                        >
                            <template #reference>
                                <div class="author">
                                    <el-icon><Avatar /></el-icon>
                                     admin
                                </div>
                            </template>
                            <div class="nickname">
                                <p>登录名:admin </p>
                                <el-tag size="small" effect="dark" class="logout" @click="logout">退出</el-tag>
                            </div>
                        </el-popover>
                    </div>
                </div>
                <div class="main">
                    <router-view />
                </div>
                <div class="footer">
                    <div class="left">底部栏</div>
                    <div class="right">
                        <a target="_blank" href="https://github.com/newbee-ltd/vue3-admin">vue3-shop</a>
                    </div>
                </div>
            </el-container>
        </el-container>
    </div>
</template>

<script setup>

</script>

<style scoped>
    .layout {
        min-height: 100vh;
        background-color: #ffffff;
    }
    .container {
        height: 100vh;
    }
    .aside {
        width: 200px!important;
        background-color: #222832;
    }
    .head {
        display: flex;
        align-items: center;
        justify-content: center;
        height: 50px;
    }
    .head > div {
        display: flex;
        align-items: center;
    }

    .head img {
        width: 50px;
        height: 50px;
        margin-right: 10px;
    }
    .head span {
        font-size: 20px;
        color: #ffffff;
    }
    .line {
        border-top: 1px solid hsla(0,0%,100%,.05);
        border-bottom: 1px solid rgba(0,0,0,.2);
    }
    .content {
        display: flex;
        flex-direction: column;
        max-height: 100vh;
        overflow: hidden;
    }
    .main {
        height: calc(100vh - 100px);
        overflow: auto;
        padding: 10px;
    }
</style>

<style>
    body {
        padding: 0;
        margin: 0;
        box-sizing: border-box;
    }
    .el-menu {
        border-right: none!important;
    }
    .el-submenu {
        border-top: 1px solid hsla(0, 0%, 100%, .05);
        border-bottom: 1px solid rgba(0, 0, 0, .2);
    }
    .el-submenu:first-child {
        border-top: none;
    }
    .el-submenu [class^="el-icon-"] {
        vertical-align: -1px!important;
    }
    a {
        color: #409eff;
        text-decoration: none;
    }
    .el-pagination {
        text-align: center;
        margin-top: 20px;
    }
    .el-popper__arrow {
        display: none;
    }
    .footer {
        height: 50px;
        border-top: 1px solid #e9e9e9;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0 20px;
    }
</style>
<style scoped>
    .header {
        height: 50px;
        border-bottom: 1px solid #e9e9e9;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0 20px;
    }
    .header .left .back {
        border: 1px solid #e9e9e9;
        padding: 5px;
        border-radius: 50%;
        margin-right: 5px;
        cursor: pointer;
    }
    .right > div > .icon{
        font-size: 18px;
        margin-right: 6px;
    }
    .author {
        margin-left: 10px;
        cursor: pointer;
    }
</style>

<style>
    .popper-user-box {
        background: url('https://s.yezgea02.com/lingling-h5/static/account-banner-bg.png') 50% 50% no-repeat!important;
        background-size: cover!important;
        border-radius: 0!important;
    }
    .popper-user-box .nickname {
        position: relative;
        color: #ffffff;
    }
    .popper-user-box .nickname .logout {
        position: absolute;
        right: 0;
        top: 0;
        cursor: pointer;
    }
</style>

图片展示如下:

  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
### 回答1: 基于Vue 3和Element Plus的后台管理开源模板是一种用于快速开发后台管理系统的框架。Vue 3是一种流行的JavaScript框架,它提供了一种简单、灵活和高效的方式来构建用户界面。Element Plus是一个基于Vue的UI组件库,它提供了一套美观、易用和高性能的组件,可以帮助开发者更方便地构建后台管理系统。 使用这个开源模板,开发者可以快速搭建一个功能完善的后台管理系统。该模板提供了许多常用的功能模块,如用户管理、权限管理、数据统计等,开发者只需根据实际需求进行定制和扩展即可。同时,该模板还提供了一套简洁、美观的界面设计,用户体验良好。 基于Vue 3和Element Plus的开源模板具有以下优点: 1. 高度可定制性:开发者可以根据项目需求自由定制模板,添加需要的功能模块和样式。 2. 简单易用:Vue 3和Element Plus都采用了简洁的API设计,使开发者能够以更快的速度进行开发。 3. 良好的兼容性:基于Vue 3和Element Plus的模板可以兼容多种浏览器和设备,保证用户能够在不同平台上正常使用。 4. 大量的组件和工具支持:Element Plus提供了大量的UI组件和工具,如表格、表单、图表等,可以帮助开发者快速构建出功能丰富的后台管理系统。 总之,基于Vue 3和Element Plus的后台管理开源模板是一种高效、灵活和易用的框架,能够帮助开发者快速搭建功能完善的后台管理系统。无论是个人项目还是企业项目,都可以通过使用这个模板来提高开发效率并获得优秀的用户体验。 ### 回答2: 基于Vue3和Element Plus创建的后台管理开源模板是一个用于快速搭建后台管理系统的框架。Vue3是一个流行的JavaScript框架,它提供了简洁、高效的开发方式,使得开发者可以轻松构建大型项目。Element Plus是一套基于Vue3的UI组件库,其中包含了许多实用的组件和工具,能够满足后台管理系统的各种需求。 这个开源模板提供了一个完整的后台管理系统的架构和样式,使得开发者可以快速搭建自己的后台管理系统。它包含了常用的功能模块,如用户管理、权限管理、数据展示、数据编辑等。同时,它还提供了丰富的UI组件和样式,使得系统的界面看起来美观、易用。 使用这个开源模板,开发者可以在短时间内搭建一个功能完善、界面漂亮的后台管理系统。它提供了一些基本的配置选项,开发者可以根据自己的需求进行定制。同时,模板代码结构清晰、易于扩展,开发者可以根据自己的业务逻辑进行修改和添加功能。 总之,基于Vue3和Element Plus创建的后台管理开源模板,是一个功能强大、易用性高的框架,能够帮助开发者快速构建自己的后台管理系统。无论是小型项目还是大型项目,都可以通过这个模板节省开发时间,提升开发效率。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

山河亦问安

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值