message-face.vue 753 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <template>
  2. <div
  3. ref="skeleton"
  4. class="message-image"
  5. >
  6. <!-- todo 统一组件处理-->
  7. <img
  8. class="message-image"
  9. :src="data.url"
  10. >
  11. </div>
  12. </template>
  13. <script lang="ts" setup>
  14. import { watchEffect, ref, nextTick } from '../../../../adapter-vue';
  15. const props = defineProps({
  16. content: {
  17. type: Object,
  18. default: () => ({}),
  19. },
  20. isPC: {
  21. type: Boolean,
  22. default: false,
  23. },
  24. });
  25. const data = ref();
  26. const skeleton: any = ref();
  27. watchEffect(() => {
  28. data.value = props.content;
  29. if (!data.value) return;
  30. nextTick(() => {
  31. // todo 大小显示
  32. });
  33. });
  34. </script>
  35. <style lang="scss" scoped>
  36. @import "../../../../assets/styles/common";
  37. .message-image {
  38. width: 80px;
  39. height: 80px;
  40. }
  41. </style>