message-face.vue 863 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <template>
  2. <div
  3. class="message-image"
  4. >
  5. <img
  6. mode="aspectFit"
  7. class="message-image"
  8. :src="url"
  9. >
  10. </div>
  11. </template>
  12. <script lang="ts" setup>
  13. import { ref, onMounted } from '../../../../adapter-vue';
  14. import { CUSTOM_BIG_EMOJI_URL } from '../../emoji-config';
  15. const props = defineProps({
  16. content: {
  17. type: Object,
  18. default: () => ({}),
  19. },
  20. });
  21. const url = ref(props.content.url);
  22. onMounted(() => {
  23. if (props.content.type === 'custom') {
  24. if (!CUSTOM_BIG_EMOJI_URL) {
  25. console.warn('CUSTOM_BIG_EMOJI_URL is required for custom emoji, please check your CUSTOM_BIG_EMOJI_URL.');
  26. } else {
  27. url.value = CUSTOM_BIG_EMOJI_URL + props.content.name;
  28. }
  29. }
  30. });
  31. </script>
  32. <style lang="scss" scoped>
  33. @import "../../../../assets/styles/common";
  34. .message-image {
  35. width: 80px;
  36. height: 80px;
  37. }
  38. </style>