feat: 首次渲染滚动到底部

This commit is contained in:
rd
2025-08-29 09:58:09 +08:00
parent 4c86a8f614
commit 5fcc91b3dd
4 changed files with 64 additions and 37 deletions

View File

@ -31,15 +31,6 @@ export default {
const sseController = ref<any>(null);
const searchValue = ref<string>('');
// 强制滚动到底部:用户主动发送消息时,无视是否在底部
const forceScrollToBottom = () => {
requestAnimationFrame(() => {
try {
bubbleListRef.value?.scrollTo?.({ top: Number.MAX_SAFE_INTEGER, behavior: 'smooth' });
} catch {}
});
};
const handleSubmit = (message: string) => {
if (generateLoading.value) {
antdMessage.warning('停止生成后可发送');
@ -94,9 +85,6 @@ export default {
}),
});
nextTick(() => {
forceScrollToBottom();
});
} catch (error) {
console.error('Failed to initialize SSE:', error);
antdMessage.error('初始化连接失败');