item.vue 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <!-- @format -->
  2. <script lang="ts" setup>
  3. defineProps({
  4. item: Object as any,
  5. })
  6. </script>
  7. <template>
  8. <div>
  9. <nuxt-link :to="{ name: 'blog-slug', params: { slug: item?.slug } }">
  10. <img :src="item.thumbnailUrl" alt="" srcset="" class="hover-effect w-352px h-352px b-rd-10px object-cover">
  11. <div class="mt-20px">
  12. <div class="mb-10px text-#666 text-14px fw-400 mb-10px">
  13. {{ item.category_dictText }}
  14. </div>
  15. <h3
  16. class="!mb-10px fw-600 text-24px text-#363C40 line-clamp-2 custom-title-font"
  17. >
  18. {{ item.contentTitle }}
  19. </h3>
  20. <div class="!mb-20px text-14px text-#999 line-clamp-2">
  21. {{ item.contentSubhead }}
  22. </div>
  23. <div
  24. class="text-14px text-#C58C64 cursor-pointer read-more pos-relative"
  25. >
  26. Read More
  27. </div>
  28. </div>
  29. </nuxt-link>
  30. </div>
  31. </template>
  32. <style lang="less" scoped>
  33. .read-more {
  34. &:after {
  35. position: absolute;
  36. content: "";
  37. bottom: -4px;
  38. left: 0;
  39. width: 20%;
  40. height: 2px;
  41. background: #cda274;
  42. border-radius: 1dvb;
  43. transition:
  44. height 0.3s,
  45. background 0.3s; /* 明确过渡效果 */
  46. }
  47. }
  48. </style>