【优化】Chat 字体滚动,如果stream结束,开始加速
This commit is contained in:
parent
055abf62cd
commit
a3c5d253b3
@ -124,8 +124,9 @@ const textRoll = async () => {
|
||||
if (textRoleRunning.value) {
|
||||
return
|
||||
}
|
||||
// 设置状态
|
||||
textRoleRunning.value = true
|
||||
|
||||
displayedText.value = ''
|
||||
const task = async () => {
|
||||
// 调整速度
|
||||
const diff = (fullText.value.length - displayedText.value.length) / 10
|
||||
@ -138,6 +139,10 @@ const textRoll = async () => {
|
||||
} else {
|
||||
textSpeed.value = 100
|
||||
}
|
||||
// 对话结束,就按30的速度
|
||||
if (!conversationInProgress.value) {
|
||||
textSpeed.value = 30
|
||||
}
|
||||
|
||||
console.log(`diff ${diff} 速度 ${textSpeed.value} `)
|
||||
// console.log('index < fullText.value.length', index < fullText.value.length, conversationInProgress.value)
|
||||
|
Loading…
Reference in New Issue
Block a user