fix: 编辑场景滑动滚动条控制台报错

This commit is contained in:
chenjianxing 2021-07-02 18:01:28 +08:00 committed by jianxing
parent b3db4f3b60
commit 73bde25387
1 changed files with 8 additions and 6 deletions

View File

@ -1285,12 +1285,14 @@ export default {
handleScroll() { handleScroll() {
let stepInfo = this.$refs.stepInfo; let stepInfo = this.$refs.stepInfo;
let debugHeader = this.$refs.debugHeader; let debugHeader = this.$refs.debugHeader;
let originWidth = debugHeader.clientWidth; if (debugHeader) {
if (stepInfo.getBoundingClientRect().top <= 178) { let originWidth = debugHeader.clientWidth;
this.isTop = true; if (stepInfo.getBoundingClientRect().top <= 178) {
debugHeader.style.width = originWidth + 'px'; this.isTop = true;
} else { debugHeader.style.width = originWidth + 'px';
this.isTop = false; } else {
this.isTop = false;
}
} }
} }
} }