Aside.vue 958 B

123456789101112131415161718192021222324252627282930313233343536373839
  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="{
  19. width: '30px',
  20. height: '30px',
  21. background: store.state.currentMenuItem.includes(item.path)
  22. ? '#fff'
  23. : ' #adacac',
  24. padding: '1px',
  25. }"
  26. :src="item.icon"
  27. alt=""
  28. />
  29. <span>{{ item.title }}</span>
  30. </template>
  31. <el-menu-item v-for="son in item.items" :index="son.path" :key="son">
  32. {{ son.name }}
  33. </el-menu-item>
  34. </el-sub-menu>
  35. </el-menu>
  36. </template>
  37. <script setup>
  38. import store from "../store";
  39. </script>