item.vue 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <!-- @format -->
  2. <script lang="ts" setup>
  3. defineProps({
  4. item: Object as any,
  5. })
  6. </script>
  7. <template>
  8. <div class="pos-relative">
  9. <nuxt-link :to="{ name: 'blog-slug', params: { slug: item?.slug } }">
  10. <img :src="item.thumbnailUrl" :alt="item.thumbnailAlt" srcset="" class="w-375px h-240px b-rd-10px object-cover">
  11. <div v-if="item.category_dictText" class="pos-absolute top-10px b-rd-400px left-10px text-center w-138px py-10px bg-#f0f1f3 text-#9B6CFF text-14px b-1px b-solid b-#e7e7e7">
  12. {{ item.category_dictText }}
  13. </div>
  14. <h3
  15. class="!mb-15px !mt-30px fw-800 text-24px text-#333 line-clamp-2 custom-title-font"
  16. >
  17. {{ item.contentTitle }}
  18. </h3>
  19. <div class="text-14px text-#999 lh-22px line-clamp-2">
  20. {{ item.contentSubhead }}
  21. </div>
  22. </nuxt-link>
  23. </div>
  24. </template>
  25. <style lang="less" scoped>
  26. .read-more {
  27. &:after {
  28. position: absolute;
  29. content: "";
  30. bottom: -4px;
  31. left: 0;
  32. width: 20%;
  33. height: 2px;
  34. background: #cda274;
  35. border-radius: 1dvb;
  36. transition:
  37. height 0.3s,
  38. background 0.3s; /* 明确过渡效果 */
  39. }
  40. }
  41. </style>