zoukankan      html  css  js  c++  java
  • elementUI三级路由

          <template v-for="item in sliders">
            <!-- 二级路由/三级路由 -->
            <template v-if="item.children&&item.children.length>0">
              <!-- 三级路由 -->
              <template v-if="item.children[0].children&&item.children[0].children.length>0">
                <el-submenu :index="item.path" :key="item.path">
                  <template slot="title">
                    <i :class="item.icon"></i>
                    <span>{{item.text}}</span>
                  </template>
                  <el-submenu :index="child.path" v-for="(child,index) in item.children" :key="index">
                    <template slot="title">
                      <i :class="child.icon"></i>
                      <span>{{child.text}}</span>
                    </template>
                    <el-menu-item
                      v-for="grandson in child.children"
                      :key="grandson.path"
                      :index="grandson.path"
                      @click="handlePush(grandson.path)"
                    >
                      <span>{{grandson.text}}</span>
                    </el-menu-item>
                  </el-submenu>
                </el-submenu>
              </template>
              <!-- 二级路由 -->
              <template v-else>
                <el-submenu :index="item.path" :key="item.path">
                  <template slot="title">
                    <i :class="item.icon"></i>
                    <span slot="title">{{item.text}}</span>
                  </template>
                  <el-menu-item
                    v-for="child in item.children"
                    :key="child.path"
                    :index="child.path"
                    @click="handlePush(child.path)"
                  >
                    <span>{{child.text}}</span>
                  </el-menu-item>
                </el-submenu>
              </template>
            </template>
            <!-- 没有子标题 -->
            <el-menu-item :index="item.path" :key="item.path" v-else @click="handlePush(item.path)">
              <i :class="item.icon"></i>
              <span>{{item.text}}</span>
            </el-menu-item>
          </template>
  • 相关阅读:
    python测试开发django-1.开始hello world!
    python基础--杂项
    Python基础----函数
    python介绍
    公共Webservice
    divmod(a,b)函数
    模块知识
    第三周作业 修改配置文件
    rsync在windows和linux同步数据的配置过程
    docker学习笔记
  • 原文地址:https://www.cnblogs.com/wuqilang/p/13180095.html
Copyright © 2011-2022 走看看