Browse Source

助手优化

master
xueyinfei 4 weeks ago
parent
commit
06c5b6fa62
  1. 13
      vue-fastapi-frontend/src/views/aichat/aichat.vue

13
vue-fastapi-frontend/src/views/aichat/aichat.vue

@ -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())
// }
}
}
}
}

Loading…
Cancel
Save