From c21adb7b5df5862a80f64bf2fab56472a84b4d77 Mon Sep 17 00:00:00 2001 From: ltyzzz Date: Wed, 14 Jun 2023 00:33:36 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20GPT=20=E8=AF=B7=E6=B1=82?= =?UTF-8?q?=E8=BF=87=E7=A8=8B=E4=B8=AD=E4=B8=8D=E5=8F=AF=E8=BE=93=E5=85=A5?= =?UTF-8?q?=E5=91=BD=E4=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/gpt-terminal/ContentOutput.vue | 16 +++++++++++- src/components/gpt-terminal/GptTerminal.vue | 25 ++++++++++++++++++- src/core/commands/gpt/subCommands/ChatBox.vue | 6 ++++- 3 files changed, 44 insertions(+), 3 deletions(-) diff --git a/src/components/gpt-terminal/ContentOutput.vue b/src/components/gpt-terminal/ContentOutput.vue index 0501f1a..9520547 100644 --- a/src/components/gpt-terminal/ContentOutput.vue +++ b/src/components/gpt-terminal/ContentOutput.vue @@ -7,6 +7,8 @@ import smartText from "../../utils/smartText"; import OutputType = GptTerminal.OutputType; -import { computed, toRefs } from "vue"; +import { computed, toRefs, defineEmits } from "vue"; interface OutputProps { output: OutputType; @@ -44,6 +46,18 @@ const outputTagColor = computed((): string => { return ""; } }); + +const emit = defineEmits(['start', 'finish']) + +// gpt 输出开始时的回调 +const handleStart = () => { + emit('start') +} + +// gpt 输出结束后的回调 +const handleFinish = () => { + emit('finish') +}