item.vue 807 B

1234567891011121314151617181920212223242526272829303132333435
  1. <script lang='ts' setup>
  2. defineProps({
  3. item: Object as any,
  4. })
  5. </script>
  6. <template>
  7. <div>
  8. <NuxtLink :to="`/categories/${item.slug}`">
  9. <div class="custom-main mx-auto overflow-hidden pos-relative">
  10. <h2 class="!mb-16px text-30px lh-32px fw-800 text-#333">
  11. {{ item.contentTitle }}
  12. </h2>
  13. <img
  14. :src="item.bannerImg"
  15. alt=""
  16. srcset=""
  17. class="w-260px h-260px object-cover mx-auto"
  18. >
  19. </div>
  20. </NuxtLink>
  21. </div>
  22. </template>
  23. <style lang="less" scoped>
  24. .custom-main{
  25. background: url('~/assets/images/swiper_bg.png') no-repeat center center;
  26. background-size: cover;
  27. width: 360px;
  28. height: 360px;
  29. border-radius: 10px;
  30. padding: 20px 0px;
  31. box-shadow: 0px 8px 32px 0px rgba(0, 0, 0, 0.16);
  32. }
  33. </style>