We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2bcfdb4 commit cce557aCopy full SHA for cce557a
1 file changed
ui/src/components/ai-chat/index.vue
@@ -645,10 +645,8 @@ const handleScroll = () => {
645
if (props.type !== 'log' && scrollDiv.value) {
646
// 内部高度小于外部高度 就需要出滚动条
647
if (scrollDiv.value.wrapRef.offsetHeight < dialogScrollbar.value.scrollHeight) {
648
- // 如果当前滚动条距离最下面的距离在 规定距离 滚动条就跟随
649
- if (scorll.value) {
650
- scrollDiv.value.setScrollTop(getMaxHeight())
651
- }
+ // 滚动到底部
+ scrollDiv.value.setScrollTop(dialogScrollbar.value.scrollHeight);
652
}
653
654
@@ -759,9 +757,11 @@ function setScrollBottom() {
759
757
watch(
760
758
chatList,
761
() => {
762
- handleScroll()
+ nextTick(() => {
+ handleScroll(); // 确保 DOM 更新后再滚动
+ });
763
},
764
- { deep: true, immediate: true },
+ {deep: true, immediate: true},
765
)
766
767
defineExpose({
0 commit comments