6
6
<div v-else-if="!hideTitle" class="text-lg font-semibold theme-text">{{ t('output.title') }}</div>
7
7
<div v-else></div>
8
8
9
- <button
10
- v-if="contentTokens.length > 0 && !isStreaming"
11
- @click="copySelectedText"
12
- class="px-3 py-1.5 theme-button-secondary flex items-center space-x-2"
13
- >
14
- <span>{{ t('prompt.copy') }}</span>
15
- </button>
9
+ <div class="flex items-center space-x-2">
10
+ <button
11
+ v-if="contentTokens.length > 0 && !isStreaming"
12
+ @click="copySelectedText"
13
+ class="px-3 py-1.5 theme-button-secondary flex items-center space-x-2"
14
+ >
15
+ <span>{{ t('prompt.copy') }}</span>
16
+ </button>
17
+ <button
18
+ @click="isFullscreen = true"
19
+ class="px-3 py-1.5 theme-button-secondary flex items-center space-x-2"
20
+ :title="t('output.expand')"
21
+ >
22
+ <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
23
+ <path stroke-linecap="round" stroke-linejoin="round" d="M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5l-5-5m5 5v-4m0 4h-4" />
24
+ </svg>
25
+ </button>
26
+ </div>
16
27
</div>
17
28
18
29
<div class="flex-1 min-h-0 relative">
44
55
</div>
45
56
</div>
46
57
</div>
58
+ <FullscreenDialog v-model="isFullscreen" :title="resultTitle || t('output.title')">
59
+ <div class="h-full theme-input whitespace-pre-wrap">
60
+ <MarkdownRenderer v-if="props.enableMarkdown" :content="displayContent" />
61
+ <span v-else v-text="displayContent" class="theme-text"></span>
62
+ </div>
63
+ </FullscreenDialog>
47
64
</template>
48
65
49
66
<script setup lang="ts">
@@ -53,12 +70,14 @@ import { useToast } from '../composables/useToast'
53
70
import { useAutoScroll } from '../composables/useAutoScroll'
54
71
import { useClipboard } from '../composables/useClipboard'
55
72
import MarkdownRenderer from './MarkdownRenderer.vue'
73
+ import FullscreenDialog from './FullscreenDialog.vue'
56
74
57
75
const { t } = useI18n()
58
76
const toast = useToast()
59
77
const { copyText } = useClipboard()
60
78
const contentTokens = ref<string[]>([])
61
79
const isStreaming = ref(false)
80
+ const isFullscreen = ref(false)
62
81
63
82
// 使用自动滚动组合式函数
64
83
const { elementRef: resultContainer, onContentChange, forceScrollToBottom, shouldAutoScroll } = useAutoScroll<HTMLDivElement>({
0 commit comments