解决流式输出的时候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 API_URL = `${import.meta.env.VITE_APP_API_BASE_URL}/chat/completion`;
|
||||||
const createParams = () => {
|
const createParams = () => {
|
||||||
const messages = dataSources.value.map((x) => {
|
const messages = dataSources.value.map((x) => {
|
||||||
@ -425,6 +427,7 @@ watch(dataSources,()=>{
|
|||||||
loading.value=false
|
loading.value=false
|
||||||
scrollToBottom('auto')
|
scrollToBottom('auto')
|
||||||
})
|
})
|
||||||
|
const inputKey=ref(1)
|
||||||
const customRequest = async (file) => {
|
const customRequest = async (file) => {
|
||||||
console.log(file,'file')
|
console.log(file,'file')
|
||||||
const res = await uploadImg({
|
const res = await uploadImg({
|
||||||
@ -485,8 +488,9 @@ const customRequest = async (file) => {
|
|||||||
<template v-else>
|
<template v-else>
|
||||||
<div>
|
<div>
|
||||||
<Message
|
<Message
|
||||||
|
|
||||||
v-for="(item, index) of dataSources"
|
v-for="(item, index) of dataSources"
|
||||||
:key="index"
|
:key="item.dateTime"
|
||||||
:date-time="item.dateTime"
|
:date-time="item.dateTime"
|
||||||
:text="item.text"
|
:text="item.text"
|
||||||
:fileList="item.fileList"
|
:fileList="item.fileList"
|
||||||
@ -616,7 +620,9 @@ const customRequest = async (file) => {
|
|||||||
/> -->
|
/> -->
|
||||||
|
|
||||||
<NInput
|
<NInput
|
||||||
|
v-memo="[prompt]"
|
||||||
style="width:75%"
|
style="width:75%"
|
||||||
|
:key="inputKey"
|
||||||
ref="inputRef"
|
ref="inputRef"
|
||||||
v-model:value="prompt"
|
v-model:value="prompt"
|
||||||
type="textarea"
|
type="textarea"
|
||||||
@ -626,6 +632,8 @@ const customRequest = async (file) => {
|
|||||||
@keypress="handleEnter"
|
@keypress="handleEnter"
|
||||||
>
|
>
|
||||||
</NInput>
|
</NInput>
|
||||||
|
|
||||||
|
|
||||||
<NButton color="#8a2be2" type="primary" size="large" :disabled="buttonDisabled" @click="handleSubmit">
|
<NButton color="#8a2be2" type="primary" size="large" :disabled="buttonDisabled" @click="handleSubmit">
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<span class="dark:text-black" v-if="!loading">
|
<span class="dark:text-black" v-if="!loading">
|
||||||
|
Loading…
Reference in New Issue
Block a user