IndexCommonImageItem.vue 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <template>
  2. <ImageBlock2
  3. :src="image"
  4. :title="title"
  5. :desc="desc"
  6. :width="340"
  7. :imageWidth="340"
  8. :imageRadius="15"
  9. :titleProps="{ fontSize: 24, color: 'gray', lines: 2 }"
  10. :descProps="{ fontSize: 24, color: 'gray', lines: 2 }"
  11. backgroundColor="transparent"
  12. @click="$emit('click')"
  13. >
  14. <template #footer>
  15. <FlexRow justify="space-between" align="center" :padding="[10,0]" :margin="[10,0,0,0]">
  16. <FlexRow align="center" :gap="10">
  17. <Avatar :url="image" :size="40" />
  18. <Text :text="userName" :fontSize="24" color="gray" />
  19. </FlexRow>
  20. <FlexRow align="center" :gap="10">
  21. <Icon icon="favorite" :color="isLike ? 'primary' : 'gray'" :size="30" />
  22. <Text :text="likes" :fontSize="30" :color="isLike ? 'primary' : 'gray'" />
  23. </FlexRow>
  24. </FlexRow>
  25. </template>
  26. </ImageBlock2>
  27. </template>
  28. <script setup lang="ts">
  29. import Text from '@/components/basic/Text.vue';
  30. import FlexRow from '@/components/layout/FlexRow.vue';
  31. import Avatar from '@/components/display/Avatar.vue';
  32. import Icon from '@/components/basic/Icon.vue';
  33. import ImageBlock2 from '@/components/display/block/ImageBlock2.vue';
  34. const props = defineProps<{
  35. image?: string;
  36. title?: string;
  37. desc?: string;
  38. userName?: string;
  39. likes?: number;
  40. isLike?: boolean;
  41. }>()
  42. const emit = defineEmits([ 'click' ]);
  43. </script>