item.vue 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <script lang='ts' setup>
  2. import { Condition } from '@/enums/const-enums'
  3. defineProps({
  4. item: Object as any,
  5. })
  6. const emit = defineEmits(['select'])
  7. </script>
  8. <template>
  9. <div>
  10. <div class="pos-relative b-rd-12px bg-#fff shadow-item overflow-hidden">
  11. <img :src="item.coverImg" :alt="item.coverAlt" srcset="" class="w-100% h-310px object-cover">
  12. <div class="p-30px">
  13. <h3
  14. class="!mb-10px fw-800 text-24px text-#333 line-clamp-2 custom-title-font"
  15. >
  16. {{ item.title }}
  17. </h3>
  18. <div class="text-16px text-#999 lh-22px line-clamp-2 mb-20px">
  19. {{ item.subhead }}
  20. </div>
  21. <el-button class="!bg-#9B6CFF !text-#fff !b-#9B6CFF !h-40px px-24px" @click="$emit('select', item)">
  22. {{ item.downloadCondition === Condition.REQUEST ? 'Request' : 'Download' }}
  23. <svgo-arrow-line-r class="w-16px h-16px ml-10px !text-#fff" />
  24. </el-button>
  25. </div>
  26. </div>
  27. </div>
  28. </template>
  29. <style lang='less' scoped>
  30. .shadow-item{
  31. box-shadow: 0px 4px 10px 0px rgba(0, 0, 0, 0.1);
  32. }
  33. </style>