前端学习笔记element-Plus

【element-plus菜单】参数说明:

active-text-color="#ffd04b"------激活颜色

background-color="#232323"------背景颜色(29,160,176)
:default-active ="$route.path"------配置默认高亮的菜单项

text-color="#fff"
router router选项开启,el-menu-item 的 index 就是点击跳转的路径

el-menu-item 菜单项

index="/article/channel" 配置的是访问的跳转路径,配合default-active的值,实现高亮

Element PLus官方网址:Container 布局容器 | Element Plus

Element PLus官方网址:Menu 菜单 | Element Plus (element-plus.org)

导航菜单默认为垂直模式,通过将 mode 属性设置为 horizontal 来使导航菜单变更为水平模式。

复制代码
 <el-menu
          active-text-color="#ffd04b"
          background-color="#232323"
          :default-active="$route.path"
          text-color="#fff"
          router
        >
          <el-menu-item index="/article/channel">
            <el-icon><Management /></el-icon>
            <span>文章分类</span>
          </el-menu-item>
          <el-menu-item index="/article/manage">
            <el-icon><Promotion /></el-icon>
            <span>文章管理</span>
          </el-menu-item>

          <el-sub-menu index="/user">
            <!-- 多级菜单的标题 - 具名插槽 title -->
            <template #title>
              <el-icon><UserFilled /></el-icon>
              <span>个人中心</span>
            </template>

            <!-- 展开的内容 - 默认插槽 -->
            <el-menu-item index="/user/profile">
              <el-icon><User /></el-icon>
              <span>基本资料</span>
            </el-menu-item>
            <el-menu-item index="/user/avatar">
              <el-icon><Crop /></el-icon>
              <span>更换头像</span>
            </el-menu-item>
            <el-menu-item index="/user/password">
              <el-icon><EditPen /></el-icon>
              <span>重置密码</span>
            </el-menu-item>
          </el-sub-menu>
        </el-menu>
相关推荐
Danny_FD7 分钟前
Vue + Element UI 实现模糊搜索自动补全
前端·javascript
gnip12 分钟前
闭包实现一个简单Vue3的状态管理
前端·javascript
斐济岛上有一只斐济18 分钟前
后端程序员的CSS复习
前端
Enddme20 分钟前
《面试必问!JavaScript 中this 全方位避坑指南 (含高频题解析)》
前端·javascript·面试
有梦想的程序员22 分钟前
微信小程序使用 Tailwind CSS version 3
前端
溟洵1 小时前
Qt 窗口 工具栏QToolBar、状态栏StatusBar
开发语言·前端·数据库·c++·后端·qt
用户2519162427111 小时前
Canvas之图像合成
前端·javascript·canvas
每天开心1 小时前
噜噜旅游App(4)——构建旅游智能客服模块,实现AI聊天
前端·微信小程序·前端框架
超凌1 小时前
el-input-number出现的点击+-按钮频现不生效
前端
三小河1 小时前
contentEditable 实现可编辑区域
前端