1
0
mirror of synced 2025-12-07 22:18:17 +08:00

fix(console): pc scroll performance

This commit is contained in:
surunzi
2020-04-29 13:29:09 +08:00
parent 2224a6bb71
commit 5fdaa2bb5f

View File

@@ -641,7 +641,7 @@ export default class Logger extends Emitter {
_renderViewport() {
const container = this._container
if (isHidden(container)) return
const { scrollTop, offsetWidth, offsetHeight } = container
const { scrollTop, clientWidth, offsetHeight } = container
let top = scrollTop
let bottom = scrollTop + offsetHeight
@@ -663,7 +663,7 @@ export default class Logger extends Emitter {
for (let i = 0; i < len; i++) {
const log = displayLogs[i]
const { width, height } = log
if (height === 0 || width !== offsetWidth) {
if (height === 0 || width !== clientWidth) {
fakeFrag.appendChild(log.el)
logs.push(log)
}