index.vue 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <template>
  2. <div
  3. v-for="item in list"
  4. :key="item.id"
  5. class="list-item"
  6. @click="
  7. $router.push({
  8. name: 'ExhibitionsDetail',
  9. query: { id: item.id, k: $route.params.type },
  10. })
  11. "
  12. >
  13. <ElImage
  14. fit="cover"
  15. :src="baseUrl + item.thumb"
  16. aria-label="Image link"
  17. :aria-description="item.name"
  18. />
  19. <div class="list-item__inner" aria-label="Link">
  20. <p class="list-item__title">{{ item.name }}</p>
  21. <p class="list-item__content limit-line line-4">
  22. {{ item.digest }}
  23. </p>
  24. </div>
  25. </div>
  26. </template>
  27. <script lang="ts" setup>
  28. import type { ExhibitionsListItem } from "@/api";
  29. import { getBaseURL } from "@dage/service";
  30. defineProps<{
  31. list: ExhibitionsListItem[];
  32. }>();
  33. const baseUrl = getBaseURL();
  34. </script>
  35. <style lang="scss" scoped>
  36. .list-item {
  37. display: flex;
  38. height: 240px;
  39. background: var(--white-bg);
  40. color: var(--black-text-color);
  41. cursor: pointer;
  42. .el-image {
  43. width: 240px;
  44. height: 100%;
  45. }
  46. &__inner {
  47. flex: 1;
  48. padding: 0 25px;
  49. border: 1px solid #c7c7c7;
  50. border-left: 0;
  51. }
  52. &__title {
  53. font-size: 18px;
  54. line-height: 22px;
  55. padding: 16px 0;
  56. margin-bottom: 13px;
  57. font-weight: bold;
  58. }
  59. &__content {
  60. font-size: 14px;
  61. line-height: 20px;
  62. color: var(--gray-text-color);
  63. }
  64. }
  65. </style>