UserAvatar.vue 680 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <template>
  2. <view class="item">
  3. <view class="img">
  4. <vim-avatar :img="chat.avatar" :name="chat.name" />
  5. </view>
  6. <view class="name">{{chat.name}}</view>
  7. </view>
  8. </template>
  9. <script setup lang="ts">
  10. import type Chat from "@/mode/Chat";
  11. import VimAvatar from "@/components/VimAvatar.vue";
  12. interface IProps{
  13. chat:Chat
  14. }
  15. let props = defineProps<IProps>();
  16. </script>
  17. <style scoped lang="scss">
  18. .item {
  19. display: inline-block;
  20. padding: 10upx;
  21. .img {
  22. text-align: center;
  23. }
  24. .name {
  25. text-align: center;
  26. margin-top: 10upx;
  27. width: 100%;
  28. white-space: nowrap;
  29. overflow: hidden;
  30. text-overflow: ellipsis;
  31. line-height: 1rem;
  32. }
  33. }
  34. </style>