|
|
|
@ -296,6 +296,7 @@ const { proxy } = getCurrentInstance(); |
|
|
|
const aiChatRef = ref() |
|
|
|
const quickInputRef = ref() |
|
|
|
const scrollDiv = ref() |
|
|
|
const scorll = ref(true) |
|
|
|
const dialogScrollbar = ref() |
|
|
|
const loading = ref(false) |
|
|
|
const inputValue = ref('') |
|
|
|
@ -388,6 +389,14 @@ const getMaxHeight = () => { |
|
|
|
|
|
|
|
const handleScrollTop = ($event) => { |
|
|
|
scrollTop.value = $event.scrollTop |
|
|
|
if ( |
|
|
|
dialogScrollbar.value.scrollHeight - (scrollTop.value + scrollDiv.value.wrapRef.offsetHeight) <= |
|
|
|
30 |
|
|
|
) { |
|
|
|
scorll.value = true |
|
|
|
} else { |
|
|
|
scorll.value = false |
|
|
|
} |
|
|
|
emit('scroll', { ...$event, dialogScrollbar: dialogScrollbar.value, scrollDiv: scrollDiv.value }) |
|
|
|
} |
|
|
|
|
|
|
|
@ -396,9 +405,9 @@ const handleScroll = () => { |
|
|
|
// 内部高度小于外部高度 就需要出滚动条 |
|
|
|
if (scrollDiv.value.wrapRef.offsetHeight < dialogScrollbar.value.scrollHeight) { |
|
|
|
// 如果当前滚动条距离最下面的距离在 规定距离 滚动条就跟随 |
|
|
|
// if (scorll.value) { |
|
|
|
if (scorll.value) { |
|
|
|
scrollDiv.value.setScrollTop(getMaxHeight()) |
|
|
|
// } |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|