• element ui 左侧导航栏


    <el-menu class="left-menu" :default-active="$route.name" :unique-opened="true" :collapse="isCollapse">
          <template v-for="(m, x) in menuOpts.data" >
            <el-submenu v-if="m.children.length && m.show" :index="m.value" class="level1-menu" :key="x">
              <template slot="title">
                <e-icon :name="m.icon"></e-icon>
                <span>{{m.label}}</span>
              </template>
              <el-menu-item-group v-if="m.children.length && m.show == true">
                <template v-for="c in m.children">
                  <el-submenu v-if="c.children && c.show == true" :index="c.value">
                    <template slot="title">{{c.label}}</template>
                    <el-menu-item class="level2-menu submenu" v-for="(child, s) in c.children" :key="s" @click.native="stateGo(child.value,1)" :index="child.value">{{child.label}}</el-menu-item>
                  </el-submenu>
                  <el-menu-item v-if="!c.children && c.show == true" :index="c.value" @click.native="stateGo(c.value,2)" class="level2-menu submenu">
                  <template slot="title">
                    <span>{{c.label}}</span>
                  </template>
                </el-menu-item>
                </template>
              </el-menu-item-group>      
            </el-submenu>
            <el-menu-item v-if="!m.children.length && m.show == true"
              :index="m.value" @click.native="stateGo(m.value,0)" class="level1-menu submenu" :key="x">
              <e-icon :name="m.icon"></e-icon>
              <span slot="title">{{m.label}}</span>
            </el-menu-item>
          </template>
        </el-menu>
     
    数据  
    menuOpts: {
     data: [
                {
                  value: 'onBoard',
                  label: '入职管理',
                  icon: 'card',
                  show: true,
                  children: [
                    {
                      value: 'home',
                      label: '入职首页',
                      icon: 'desktop',
                      show: true,
                    },
                    {
                      value: 'onBoard.joined',
                      label: '已入职',
                      show: true
                    },
                    {
                      value: 'onBoard.history',
                      label: '历史已入职',
                      show: true
                   }
                  ]
                },
                {
                  value: 'renewal',
                  label: '合同续签',
                  icon: 'card',
                  show: true,
                  children: [
                    {
                      value: 'renewal.waiting',
                      label: '待续签',
                      show: true
                    },
                    {
                      value: 'renewal.joined',
                      label: '已续签',
                      show: true
                    },
                    {
                      value: 'renewal.unjoined',
                      label: '未续签',
                      show: true
                    },
                  ]
                },
    {
                  value: 'system',
                  label: '系统配置管理',
                  icon: 'setting',
                  show: true,
                  children: [
                    {
                      value: 'system.tenant',
                      label: '租户定义',
                      show: true,
                    },
                    {
                      value: 'system.renewal',
                      label: '合同续签',
                      show: true,
                      children: [
                        {
                          value: 'system.renewal.material',
                          label: '资料配置',
                          show: true
                        },
                      ]
                    },
                    {
                      value: 'system.leave',
                      label: '离职管理',
                      show: true,
                      children: [
                        {
                          value: 'system.leave.material',
                          label: '资料配置',
                          show: true
                        },
                      ]
                    },
                  ]
                }
              ],
              active: 'home'
    }
  • 相关阅读:
    .NET面试题系列[2]
    .NET面试题系列[1]
    被淡忘的c#析构函数
    关于Spring IOC容器解释
    工作随笔记 点击除div自身之外的地方,关闭自己
    js获得控件位置
    PHP如何判断对象为空的方法分享
    PHP 网页调用本地exe程序实例
    PHP jQuery实现上传图片时预览图片的功能实例
    Yii 自带的分页实例
  • 原文地址:https://www.cnblogs.com/dreammiao/p/14168742.html
Copyright © 2020-2023  润新知