当前位置: 首页 > article >正文

第73左侧菜单实现

layout下面新建menu

在这里插入图片描述

layout index.vue导入menu

import Menu from '@/views/layout/menu'

在这里插入图片描述
菜单实现:

<template>
  <el-menu
      active-text-color="#ffd04b"
      background-color="#2d3a4b"
      class="el-menu-vertical-demo"
      default-active="home"
      text-color="#fff"
      router
  >
    <el-menu-item index="home">
      <el-icon><home-filled /></el-icon>
      <span>首页</span>
    </el-menu-item>

    <el-menu-item index="user">
      <el-icon><user /></el-icon>
      <span>用户管理</span>
    </el-menu-item>

    <el-sub-menu index="3">
      <template #title >
        <el-icon><management /></el-icon>
        <span>商品类别管理</span>
      </template>
      <el-menu-item index="bigType">
        <el-icon><management /></el-icon>
        <span>商品大类管理</span>
      </el-menu-item>
      <el-menu-item index="smallType">
        <el-icon><management /></el-icon>
        <span>商品小类管理</span>
      </el-menu-item>
    </el-sub-menu>

    <el-menu-item index="product">
      <el-icon><tickets /></el-icon>
      <span>商品管理</span>
    </el-menu-item>

    <el-menu-item index="order">
      <el-icon><tickets /></el-icon>
      <span>订单管理</span>
    </el-menu-item>

    <el-sub-menu index="11">
      <template #title >
        <el-icon><management /></el-icon>
        <span>系统管理</span>
      </template>
      <el-menu-item index="modifyPassword">
        <el-icon><edit /></el-icon>
        <span>修改密码</span>
      </el-menu-item>
      <el-menu-item >
        <el-icon @click="logout"><switch-button /></el-icon>
        <span @click="logout">安全退出</span>
      </el-menu-item>
    </el-sub-menu>
  </el-menu>
</template>

<script setup>
import {HomeFilled,User,Tickets,Goods,DocumentAdd,Management,Setting,Edit,SwitchButton} from '@element-plus/icons-vue'

</script>

<style lang="scss" scoped>

</style>

layout修改:

<template>
  <div class="app-wrapper">
    <el-container>
      <el-aside width="200px" class="sidebar-container"><Menu/></el-aside>
      <el-container>
        <el-header>Header</el-header>
        <el-main>Main</el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script setup>
import Menu from '@/views/layout/menu'
</script>

<style lang="scss" scoped>

.app-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
}

.sidebar-container {
  background-color: #2d3a4b;
  height: 100%;
}

::v-deep .el-container{
  height: 100%;
}

</style>

在这里插入图片描述


http://www.kler.cn/news/235061.html

相关文章:

  • 腾讯云4核8G服务器可以用来干嘛?怎么收费?
  • 操作系统——文件管理面试问题整理
  • Spring Native 解放 JVM
  • Shell之sed
  • 8 scala的伴生对象
  • CDN缓存404、403状态码
  • 分布式缓存
  • Qt中程序发布及常见问题
  • 解释Java中的并发集合类,比如ConcurrentHashMap和CopyOnWriteArrayList
  • 【原创 附源码】Flutter安卓及iOS海外登录--Facebook登录最详细流程
  • unity学习案例总结
  • JDK、JRE、JVM三者关系详解
  • 案例:CentOS8 在 MySQL8.0 实现半同步复制
  • c语言求多边形面积
  • labelImg和labelme区别
  • Win10截图的四种方式
  • Java基础:值传递和引用传递
  • 【C语言】C的整理记录
  • springboot/ssm大学生选修选课系统高校选课排课成绩管理系统Java系统
  • react中hook封装一个table组件 与 useColumns组件
  • Nginx报错合集(502 Bad Gateway,504 Gateway nginx/1.18.0 (Ubuntu) 等等报错)
  • 第三节 zookeeper基础应用与实战2
  • springboot181基于springboot的乐享田园系统
  • 【AIGC风格prompt深度指南】掌握绘画风格关键词,实现艺术模仿的革新实践
  • AutoSAR(基础入门篇)7.3-使用DEV配置SWCRTE
  • Visual Studio使用Git忽略不想上传到远程仓库的文件
  • 假期刷题打卡--Day26
  • 品牌如何营造生活感氛围?媒介盒子分享
  • 2024-02-11 Unity 编辑器开发之编辑器拓展2 —— 自定义窗口
  • 【JavaEE Spring 项目】博客系统