mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-07-27 08:48:18 +08:00
优化消息对话框和消息视图组件:增加消息对话框和滚动容器的引用,调整滚动逻辑以确保更流畅的用户体验,更新样式以改善消息显示效果
This commit is contained in:
@@ -46,8 +46,11 @@ const user_message = ref('')
|
||||
// 发送按钮是否可用
|
||||
const sendButtonDisabled = ref(false)
|
||||
|
||||
// 聊天容器
|
||||
const chatContainer = ref<HTMLElement>()
|
||||
// 消息对话框引用
|
||||
const messageDialogRef = ref<any>(null)
|
||||
|
||||
// 滚动容器引用
|
||||
const messageContentRef = ref<any>()
|
||||
|
||||
// 定义捷径列表
|
||||
const shortcuts = [
|
||||
@@ -102,11 +105,17 @@ function openDialog(dialogRef: any) {
|
||||
|
||||
// 滚动到底部
|
||||
function scrollMessageToEnd() {
|
||||
nextTick(() => {
|
||||
if (chatContainer.value) {
|
||||
chatContainer.value.scrollTop = chatContainer.value.scrollHeight
|
||||
// 使用更长的延迟确保DOM已更新
|
||||
setTimeout(() => {
|
||||
try {
|
||||
const cardText = document.querySelector('.v-dialog .v-card-text')
|
||||
if (cardText) {
|
||||
cardText.scrollTop = cardText.scrollHeight
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
}
|
||||
})
|
||||
}, 500) // 增加延迟时间
|
||||
}
|
||||
|
||||
// 拼接全部日志url
|
||||
|
||||
Reference in New Issue
Block a user