Aside.vue 795 B

1234567891011121314151617181920212223242526272829303132
  1. <template>
  2. <el-menu
  3. :default-active="store.state.currentMenuItem"
  4. style="height: 100%"
  5. background-color="#141B29"
  6. text-color="#fff"
  7. active-text-color="#ffd04b"
  8. :router="true"
  9. :collapse="true"
  10. >
  11. <el-sub-menu
  12. v-for="(item, index) in store.state.menuData"
  13. :key="item"
  14. :index="`${index}`"
  15. >
  16. <template v-slot:title>
  17. <img
  18. style="width: 30px; height: 30px; background: #fff; padding: 1px"
  19. :src="item.icon"
  20. alt=""
  21. />
  22. <span>{{ item.title }}</span>
  23. </template>
  24. <el-menu-item v-for="son in item.items" :index="son.path" :key="son">
  25. {{ son.name }}
  26. </el-menu-item>
  27. </el-sub-menu>
  28. </el-menu>
  29. </template>
  30. <script setup>
  31. import store from "../store";
  32. </script>