diff --git a/frontend/src/components/ChatView.vue b/frontend/src/components/ChatView.vue index c7dc2a7..fed9efa 100644 --- a/frontend/src/components/ChatView.vue +++ b/frontend/src/components/ChatView.vue @@ -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, () => { diff --git a/frontend/src/components/ProcessBlock.vue b/frontend/src/components/ProcessBlock.vue index a853991..b2d65c8 100644 --- a/frontend/src/components/ProcessBlock.vue +++ b/frontend/src/components/ProcessBlock.vue @@ -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) {