fix: 修复查看任务日志偶发性无法自动滚动底部的bug

This commit is contained in:
xiaojunnuo
2025-01-19 23:13:30 +08:00
parent c085bac5d8
commit 7e482f798c
3 changed files with 13 additions and 2 deletions
@@ -89,7 +89,11 @@ export default {
return;
}
//判断当前是否在底部
const isBottom = el ? el.scrollHeight - el.scrollTop === el.clientHeight : true;
let isBottom = true;
if (el) {
isBottom = el.scrollHeight - el.scrollTop - el.clientHeight < 5;
console.log("isBottom", isBottom, el.scrollHeight, el.scrollTop, el.clientHeight);
}
await nextTick();
el = document.querySelector(`.pi-task-view-logs.id-${node.node.id}`);
//如果在底部则滚动到底部