feat: 首次渲染滚动到底部
This commit is contained in:
@ -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('初始化连接失败');
|
||||
|
||||
Reference in New Issue
Block a user