bug修复
This commit is contained in:
parent
eb7b4e963f
commit
2e4e30abc0
@ -85,13 +85,22 @@ const emits = defineEmits(['onDeleteSuccess', 'onRefresh', 'onEdit','update:list
|
||||
/** 滚动到底部 */
|
||||
const scrollToBottom = async (isIgnore?: boolean) => {
|
||||
// 注意要使用 nextTick 以免获取不到 dom
|
||||
await nextTick()
|
||||
if (isIgnore || !isScrolling.value) {
|
||||
messageContainer.value.scrollTop =
|
||||
messageContainer.value.scrollHeight - messageContainer.value.offsetHeight
|
||||
}
|
||||
await nextTick();
|
||||
setTimeout(() => {
|
||||
if (isIgnore || !isScrolling.value) {
|
||||
const container = messageContainer.value;
|
||||
if (container) {
|
||||
container.scrollTop = container.scrollHeight - container.offsetHeight;
|
||||
console.log('ScrollTop:', container.scrollTop);
|
||||
}
|
||||
}
|
||||
}, 200);
|
||||
}
|
||||
|
||||
watch(list, () => {
|
||||
nextTick();
|
||||
scrollToBottom();
|
||||
}, { deep: true });
|
||||
function handleScroll() {
|
||||
const scrollContainer = messageContainer.value
|
||||
const scrollTop = scrollContainer.scrollTop
|
||||
|
Loading…
Reference in New Issue
Block a user