fix: 修复流式生成时页面抖动

This commit is contained in:
ViperEkura 2026-03-26 17:24:53 +08:00
parent de79c227e2
commit 9fb32f1074
2 changed files with 7 additions and 1 deletions

View File

@ -189,8 +189,13 @@ function scrollToBottom(smooth = true) {
})
}
// 使 instant smooth
watch([() => props.messages.length, () => props.streamingContent], () => {
scrollToBottom()
nextTick(() => {
const el = scrollContainer.value
if (!el) return
el.scrollTo({ top: el.scrollHeight, behavior: props.streaming ? 'instant' : 'smooth' })
})
})
watch(() => props.conversation?.id, () => {

View File

@ -411,6 +411,7 @@ watch(() => props.streamingContent?.length, () => {
line-height: 1.7;
color: var(--text-primary);
word-break: break-word;
contain: layout style;
}
.text-content :deep(.placeholder) {