ThreeImageList.vue 964 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <template>
  2. <div class="ThreeImageList d-flex flex-row flex-wrap th">
  3. <NuxtLink
  4. v-for="(item, index) in list"
  5. :key="index"
  6. :to="item.link"
  7. class="item"
  8. >
  9. <ImageTitleBlock
  10. :image="item.image"
  11. :title="item.title"
  12. :desc="item.desc"
  13. />
  14. </NuxtLink>
  15. </div>
  16. </template>
  17. <script setup lang="ts">
  18. import type { PropType } from 'vue';
  19. import ImageTitleBlock from './ImageTitleBlock.vue';
  20. defineProps({
  21. list : {
  22. type: Object as PropType<{title: string, image: string, desc: string, link: string }[]>,
  23. default: () => [],
  24. }
  25. })
  26. </script>
  27. <style lang="scss">
  28. .ThreeImageList {
  29. position: relative;
  30. gap: 30px;
  31. .item {
  32. width: calc(33.33% - 20px);
  33. margin-right: 0;
  34. }
  35. }
  36. @media (max-width: 900px) {
  37. .ThreeImageList {
  38. .item {
  39. width: calc(50% - 15px);
  40. }
  41. }
  42. }
  43. @media (max-width: 600px) {
  44. .ThreeImageList {
  45. .item {
  46. width: 100%;
  47. }
  48. }
  49. }
  50. </style>