style:resize时重置黑窗口大小

This commit is contained in:
zhangyu
2020-06-29 18:47:48 +08:00
parent a23f3725e8
commit abcef1fe24

View File

@@ -72,7 +72,10 @@ export default {
} }
//调整终端可视区域高度 //调整终端可视区域高度
document.getElementsByClassName('xterm-screen')[this.idIndex].style.height=`${consoleHeigt}px`; document.getElementsByClassName('xterm-screen')[this.idIndex].style.height=`${consoleHeigt}px`;
this.term.resize(parseInt(cols),(parseInt(rows)-this.minRow)); // this.term.resize(parseInt(cols),(parseInt(rows)-this.minRow));
this.$nextTick(()=>{// 解决进入全屏和退出全屏是底部隐藏
this.setFontSize(this.fontSize);
})
}, },
resizeServiceConsole(){ resizeServiceConsole(){
const consoleBox = document.getElementById('ternimalContainer'+this.idIndex); const consoleBox = document.getElementById('ternimalContainer'+this.idIndex);
@@ -290,6 +293,9 @@ export default {
this.term.attach(this.terminalSocket); this.term.attach(this.terminalSocket);
this.term._initialized = true; this.term._initialized = true;
this.term.fit();//自适应大小(使终端的尺寸和几何尺寸适合于终端容器的尺寸) 只是width this.term.fit();//自适应大小(使终端的尺寸和几何尺寸适合于终端容器的尺寸) 只是width
this.$nextTick(()=>{// 解决进入全屏和退出全屏是底部隐藏
this.setFontSize(this.fontSize);
})
}, },
closeSocket(){ closeSocket(){