Menu.vue 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <template>
  2. <ul class="collection-menu">
  3. <li
  4. v-for="item in NAV_LIST"
  5. :key="item.type"
  6. tabindex="0"
  7. :aria-description="item.name"
  8. :class="{
  9. active: $route.params.type === item.type,
  10. }"
  11. @click="
  12. $router.push({ name: 'Collections', params: { type: item.type } })
  13. "
  14. >
  15. <p>{{ item.name }}</p>
  16. </li>
  17. </ul>
  18. </template>
  19. <script lang="ts" setup>
  20. // import { getCollectionThumbListApi, type CollectionThumbListItem } from "@/api";
  21. import { NAV_LIST } from "../constants";
  22. // import { onMounted, ref } from "vue";
  23. // import { getBaseURL } from "@dage/service";
  24. // const baseUrl = getBaseURL();
  25. // const list = ref<CollectionThumbListItem[]>([]);
  26. // onMounted(() => {
  27. // getThumbList();
  28. // });
  29. // const getThumbList = async () => {
  30. // const data = await getCollectionThumbListApi();
  31. // list.value = data;
  32. // };
  33. </script>
  34. <style lang="scss" scoped>
  35. .collection-menu {
  36. li {
  37. position: relative;
  38. border-bottom: 1px solid #fff;
  39. background: #181818 no-repeat 100%;
  40. @for $i from 1 through 11 {
  41. &:nth-child(#{$i}) {
  42. background-image: url("../images/tab/#{$i}-min.png");
  43. }
  44. }
  45. &:last-child {
  46. border: none;
  47. }
  48. &:hover,
  49. &.active {
  50. p {
  51. background: rgba(254, 24, 24, 0.7);
  52. }
  53. }
  54. p {
  55. height: 47px;
  56. line-height: 47px;
  57. text-indent: 10px;
  58. font-size: 14px;
  59. color: white;
  60. cursor: pointer;
  61. }
  62. }
  63. }
  64. </style>