当前位置:   article > 正文

element动态菜单和图标_el-icon-menu

el-icon-menu
  1. <el-aside :width="isCollapse ? '64px' : '200px'">
  2. <el-menu
  3. :default-openeds="openeds"
  4. :defaultOpeneds="['11','12','13']"
  5. :router="true"
  6. :collapse-transition="false"
  7. :collapse="isCollapse"
  8. background-color="#fff"
  9. text-color="#333"
  10. >
  11. <!-- 一级菜单 -->
  12. <el-submenu :index="item.id + ''" v-for="item in list" :key="item.id">
  13. <template slot="title">
  14. <i :class="iconsObj[item.id]"></i>
  15. <span>{{ item.authName }}</span>
  16. </template>
  17. <!-- 二级菜单 -->
  18. <el-menu-item
  19. :index="'/' + item1.path + ''"
  20. v-for="item1 in item.children"
  21. :key="item1.id"
  22. @click="saveNavState('/' + item1.path)"
  23. >
  24. <template slot="title">
  25. <i class="el-icon-menu"></i>
  26. <span>{{ item1.authName }}</span>
  27. </template>
  28. </el-menu-item>
  29. </el-submenu>
  30. </el-menu>
  31. </el-aside>
  1. //菜单图标假数据
  2. iconsObj: {
  3. 11: "iconfont icon-yunyingzhongxin",
  4. 12: "iconfont icon-yonghuzhongxin_yonghuliebiao",
  5. 13: "iconfont icon-caiwuzhongxin",
  6. 14: "iconfont icon-shangpinguanli",
  7. 15: "iconfont icon-peizhiguanli1",
  8. 16: "iconfont icon-xitongpeizhi",
  9. },
  10. //菜单假数据
  11. list: [
  12. {
  13. authName: "用户中心",
  14. children: [
  15. {
  16. authName: "用户列表",
  17. id: 1,
  18. // order: 7,
  19. path: "userlist",
  20. },
  21. { authName: "用户资金明细", id: 2, order: 8, path: "usercapitaldetail" },
  22. ],
  23. id: 11,
  24. // order: 58,
  25. path: "usercenter",
  26. },
  27. {
  28. authName: "设备中心",
  29. children: [
  30. {
  31. authName: "充电站列表",
  32. id: 4,
  33. order: 1,
  34. path: "chargerlist",
  35. },
  36. { authName: "充电桩列表", id: 5, order: 1, path: "stationlist" },
  37. { authName: "电价配置", id: 6, order: 1, path: "electricitycofig" },
  38. { authName: "报修列表", id: 7, order: 1, path: "repairlist" },
  39. ],
  40. id: 12,
  41. // order: 2,
  42. path: "devicecenter",
  43. },
  44. {
  45. authName: "财务中心",
  46. children: [
  47. { authName: "订单列表", id: 8, order: 1, path: "orderlist" },
  48. { authName: "充值列表", id: 9, order: 1, path: "paylist" },
  49. { authName: "收款列表", id: 10, order: 1, path: "cashinlist" },
  50. ],
  51. id: 13,
  52. // order: 3,
  53. path: "financecenter",
  54. },
  55. {
  56. authName: "合作中心",
  57. children: [
  58. { authName: "合作商家", id: 12, order: 1, path: "cooperateshops" },
  59. { authName: "结算管理", id: 13, order: 1, path: "balancemanage" },
  60. ],
  61. id: 14,
  62. // order: 4,
  63. path: "cooperatecenter",
  64. },
  65. {
  66. authName: "系统管理",
  67. children: [
  68. { authName: "管理员列表", id: 14, order: 1, path: "adminlist" },
  69. { authName: "菜单列表", id: 15, order: 1, path: "menulist" },
  70. { authName: "日志列表", id: 16, order: 1, path: "loglist" },
  71. ],
  72. id: 15,
  73. // order: 5,
  74. path: "stystemmanage",
  75. },
  76. ],

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/很楠不爱3/article/detail/113204?site
推荐阅读
相关标签