|
1 | 1 | <template> |
2 | | - <div class='menu-wrapper'> |
3 | | - <template v-for="item in routes"> |
| 2 | + <div class='menu-wrapper'> |
| 3 | + <template v-for="item in routes"> |
4 | 4 |
|
5 | | - <router-link v-if="!item.hidden&&item.noDropdown&&item.children.length>0" :to="item.path+'/'+item.children[0].path"> |
6 | | - <el-menu-item :index="item.path+'/'+item.children[0].path" class='submenu-title-noDropdown'> |
7 | | - <icon-svg v-if='item.icon' :icon-class="item.icon"></icon-svg><span slot="title">{{item.children[0].name}}</span> |
8 | | - </el-menu-item> |
9 | | - </router-link> |
| 5 | + <router-link v-if="!item.hidden&&item.noDropdown&&item.children.length>0" :to="item.path+'/'+item.children[0].path"> |
| 6 | + <el-menu-item :index="item.path+'/'+item.children[0].path" class='submenu-title-noDropdown'> |
| 7 | + <icon-svg v-if='item.icon' :icon-class="item.icon"></icon-svg><span>{{item.children[0].name}}</span> |
| 8 | + </el-menu-item> |
| 9 | + </router-link> |
10 | 10 |
|
11 | | - <el-submenu :index="item.name" v-if="!item.noDropdown&&!item.hidden"> |
12 | | - <template slot="title"> |
13 | | - <icon-svg v-if='item.icon' :icon-class="item.icon"></icon-svg><span>{{item.name}}</span> |
14 | | - </template> |
15 | | - <template v-for="child in item.children" v-if='!child.hidden'> |
| 11 | + <el-submenu :index="item.name" v-if="!item.noDropdown&&!item.hidden"> |
| 12 | + <template slot="title"> |
| 13 | + <icon-svg v-if='item.icon' :icon-class="item.icon"></icon-svg><span>{{item.name}}</span> |
| 14 | + </template> |
| 15 | + <template v-for="child in item.children" v-if='!child.hidden'> |
16 | 16 |
|
17 | | - <sidebar-item class='nest-menu' v-if='child.children&&child.children.length>0' :routes='[child]'> </sidebar-item> |
| 17 | + <sidebar-item class='nest-menu' v-if='child.children&&child.children.length>0' :routes='[child]'> </sidebar-item> |
18 | 18 |
|
19 | | - <router-link v-else :to="item.path+'/'+child.path"> |
20 | | - <el-menu-item :index="item.path+'/'+child.path"> |
21 | | - <icon-svg v-if='child.icon' :icon-class="child.icon"></icon-svg><span>{{child.name}}</span> |
22 | | - </el-menu-item> |
23 | | - </router-link> |
| 19 | + <router-link v-else :to="item.path+'/'+child.path"> |
| 20 | + <el-menu-item :index="item.path+'/'+child.path"> |
| 21 | + <icon-svg v-if='child.icon' :icon-class="child.icon"></icon-svg><span>{{child.name}}</span> |
| 22 | + </el-menu-item> |
| 23 | + </router-link> |
24 | 24 |
|
25 | | - </template> |
| 25 | + </template> |
26 | 26 |
|
27 | | - </el-submenu> |
| 27 | + </el-submenu> |
28 | 28 |
|
29 | | - </template> |
30 | | - </div> |
| 29 | + </template> |
| 30 | + </div> |
31 | 31 | </template> |
32 | 32 |
|
33 | 33 | <script> |
|
41 | 41 | } |
42 | 42 | </script> |
43 | 43 |
|
44 | | -<style rel="stylesheet/scss" lang="scss" scoped> |
45 | | -
|
46 | | -</style> |
47 | | - |
0 commit comments