解决流式输出的时候input不能输入的问题
This commit is contained in:
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({
|
||||
@ -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"
|
||||
@ -616,7 +620,9 @@ const customRequest = async (file) => {
|
||||
/> -->
|
||||
|
||||
<NInput
|
||||
v-memo="[prompt]"
|
||||
style="width:75%"
|
||||
:key="inputKey"
|
||||
ref="inputRef"
|
||||
v-model:value="prompt"
|
||||
type="textarea"
|
||||
@ -626,6 +632,8 @@ const customRequest = async (file) => {
|
||||
@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…
Reference in New Issue
Block a user