解决流式输出的时候input不能输入的问题

main
Phoenix 5 months ago
parent cdafe30d33
commit 73a46b08dc

@ -93,7 +93,9 @@ function handleSubmit() {
}
} */
watch(prompt,()=>{
console.log(prompt.value,'prompt.value')
})
const API_URL = `${import.meta.env.VITE_APP_API_BASE_URL}/chat/completion`;
const createParams = () => {
const messages = dataSources.value.map((x) => {
@ -425,6 +427,7 @@ watch(dataSources,()=>{
loading.value=false
scrollToBottom('auto')
})
const inputKey=ref(1)
const customRequest = async (file) => {
console.log(file,'file')
const res = await uploadImg({
@ -469,7 +472,7 @@ const customRequest = async (file) => {
</div>
</transition>
<div id="scrollRef" ref="scrollRef" class="h-full overflow-hidden overflow-y-auto">
<div id="scrollRef" ref="scrollRef" class="h-full overflow-hidden overflow-y-auto">
<div
id="image-wrapper"
class="w-full max-w-screen-xl m-auto dark:bg-[#101014]"
@ -485,8 +488,9 @@ const customRequest = async (file) => {
<template v-else>
<div>
<Message
v-for="(item, index) of dataSources"
:key="index"
:key="item.dateTime"
:date-time="item.dateTime"
:text="item.text"
:fileList="item.fileList"
@ -615,17 +619,21 @@ const customRequest = async (file) => {
@keypress="handleEnter"
/> -->
<NInput
style="width:75%"
ref="inputRef"
v-model:value="prompt"
type="textarea"
size="large"
:placeholder="placeholder"
:autosize="{ minRows: 1, maxRows: isMobile ? 4 : 8 }"
@keypress="handleEnter"
>
</NInput>
<NInput
v-memo="[prompt]"
style="width:75%"
:key="inputKey"
ref="inputRef"
v-model:value="prompt"
type="textarea"
size="large"
:placeholder="placeholder"
:autosize="{ minRows: 1, maxRows: isMobile ? 4 : 8 }"
@keypress="handleEnter"
>
</NInput>
<NButton color="#8a2be2" type="primary" size="large" :disabled="buttonDisabled" @click="handleSubmit">
<template #icon>
<span class="dark:text-black" v-if="!loading">

Loading…
Cancel
Save