mirror of
https://github.com/liriliri/eruda.git
synced 2026-02-02 09:49:00 +08:00
fix(console): pc scroll performance
This commit is contained in:
@@ -641,7 +641,7 @@ export default class Logger extends Emitter {
|
|||||||
_renderViewport() {
|
_renderViewport() {
|
||||||
const container = this._container
|
const container = this._container
|
||||||
if (isHidden(container)) return
|
if (isHidden(container)) return
|
||||||
const { scrollTop, offsetWidth, offsetHeight } = container
|
const { scrollTop, clientWidth, offsetHeight } = container
|
||||||
let top = scrollTop
|
let top = scrollTop
|
||||||
let bottom = scrollTop + offsetHeight
|
let bottom = scrollTop + offsetHeight
|
||||||
|
|
||||||
@@ -663,7 +663,7 @@ export default class Logger extends Emitter {
|
|||||||
for (let i = 0; i < len; i++) {
|
for (let i = 0; i < len; i++) {
|
||||||
const log = displayLogs[i]
|
const log = displayLogs[i]
|
||||||
const { width, height } = log
|
const { width, height } = log
|
||||||
if (height === 0 || width !== offsetWidth) {
|
if (height === 0 || width !== clientWidth) {
|
||||||
fakeFrag.appendChild(log.el)
|
fakeFrag.appendChild(log.el)
|
||||||
logs.push(log)
|
logs.push(log)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user