Post.vue 754 B

1234567891011121314151617181920212223242526272829303132
  1. <template>
  2. <div class="flex flex-col gap-2 text-foreground bg-background-100 rounded-lg overflow-hidden show">
  3. <div class="flex gap-4 items-center m-2">
  4. <img
  5. :src="props.avatar"
  6. :alt="`Avatar of ${props.author}`"
  7. class="bg-white rounded-full"
  8. >
  9. <p v-text="props.author" />
  10. </div>
  11. <div
  12. class="news-content px-2"
  13. v-html="props.raw_content"
  14. />
  15. <div class="w-full text-right -mt-2 px-2 pb-2 text-sm font-medium opacity-50">
  16. {{ props.date }}
  17. </div>
  18. </div>
  19. </template>
  20. <script setup lang="ts">
  21. interface PostList {
  22. title: string
  23. avatar: string
  24. author: string
  25. date: string
  26. raw_content: string
  27. attachments: []
  28. }
  29. const props = defineProps<PostList>()
  30. </script>