You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
930 B

  1. <template>
  2. <div class="thinking-gif-container">
  3. <img
  4. v-if="gifSrc"
  5. :src="gifSrc"
  6. alt="思考过程"
  7. class="thinking-gif"
  8. />
  9. </div>
  10. </template>
  11. <script setup>
  12. import { ref, computed } from 'vue';
  13. // 导入思考过程GIF
  14. import thinkingGif from "@/assets/img/gif/思考.gif";
  15. import analyzeGif from "@/assets/img/gif/解析.gif";
  16. import generateGif from "@/assets/img/gif/生成.gif";
  17. const props = defineProps({
  18. type: {
  19. type: String,
  20. default: 'thinking'
  21. }
  22. });
  23. const gifSrc = computed(() => {
  24. switch(props.type) {
  25. case 'thinking':
  26. return thinkingGif;
  27. case 'analyze':
  28. return analyzeGif;
  29. case 'generate':
  30. return generateGif;
  31. default:
  32. return thinkingGif;
  33. }
  34. });
  35. </script>
  36. <style scoped>
  37. .thinking-gif-container {
  38. display: flex;
  39. justify-content: center;
  40. margin: 10px 0;
  41. }
  42. .thinking-gif {
  43. max-width: 100%;
  44. height: auto;
  45. }
  46. </style>