File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
ui/src/components/ai-chat Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -645,10 +645,8 @@ const handleScroll = () => {
645645 if (props .type !== ' log' && scrollDiv .value ) {
646646 // 内部高度小于外部高度 就需要出滚动条
647647 if (scrollDiv .value .wrapRef .offsetHeight < dialogScrollbar .value .scrollHeight ) {
648- // 如果当前滚动条距离最下面的距离在 规定距离 滚动条就跟随
649- if (scorll .value ) {
650- scrollDiv .value .setScrollTop (getMaxHeight ())
651- }
648+ // 滚动到底部
649+ scrollDiv .value .setScrollTop (dialogScrollbar .value .scrollHeight );
652650 }
653651 }
654652}
@@ -759,9 +757,11 @@ function setScrollBottom() {
759757watch (
760758 chatList ,
761759 () => {
762- handleScroll ()
760+ nextTick (() => {
761+ handleScroll (); // 确保 DOM 更新后再滚动
762+ });
763763 },
764- { deep: true , immediate: true },
764+ {deep: true , immediate: true },
765765)
766766
767767defineExpose ({
You can’t perform that action at this time.
0 commit comments