Post.vue 1018 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <template>
  2. <div class="flex flex-col gap-2 text-foreground bg-background-100 rounded-lg overflow-hidden">
  3. <NuxtImg
  4. :src="$props.image"
  5. :alt="'Возникла проблема с загрузкой фото, попробуйте позже.'"
  6. class="h-[200px] object-cover object-center"
  7. :height="200"
  8. :custom="true"
  9. :quality="10"
  10. v-slot="{ src, isLoaded, imgAttrs }"
  11. >
  12. <img
  13. v-if="isLoaded"
  14. v-bind="imgAttrs"
  15. :src="src"
  16. >
  17. <div v-else class="w-full h-[200px] loading" />
  18. </NuxtImg>
  19. <div class="px-2 leading-none text-xl font-semibold">
  20. {{ $props.title }}
  21. </div>
  22. <div class="px-2 font-medium">
  23. {{ $props.description }}
  24. </div>
  25. <div class="w-full text-right -mt-2 px-2 pb-2 text-sm font-medium opacity-50">
  26. {{ $props.date }}
  27. </div>
  28. </div>
  29. </template>
  30. <script setup lang="ts">
  31. defineProps<{
  32. image?: string
  33. title?: string
  34. description?: string
  35. date?: string
  36. }>()
  37. </script>