fix: 修复浏览器resize时terminal报错的问题

This commit is contained in:
陈劲松
2020-10-26 10:11:32 +08:00
committed by chenjinsong
parent 40d880a186
commit 2e7a17eeae

View File

@@ -58,7 +58,7 @@ export default {
}, },
resize(consoleHeigt,consoleWidth){ resize(consoleHeigt,consoleWidth){
this.resizeConsole(consoleHeigt,consoleWidth); this.resizeConsole(consoleHeigt,consoleWidth);
this.resizeServiceConsole(); this.resizeServiceConsole(consoleHeigt);
}, },
resizeConsole(consoleHeigt,consoleWidth){ resizeConsole(consoleHeigt,consoleWidth){
//调整终端容器高度 //调整终端容器高度
@@ -325,8 +325,6 @@ export default {
document.getElementsByClassName('xterm-screen')[this.idIndex].style.height=height+'px' document.getElementsByClassName('xterm-screen')[this.idIndex].style.height=height+'px'
this.$nextTick(()=>{ this.$nextTick(()=>{
this.term.resize(this.term.cols,this.term.rows); this.term.resize(this.term.cols,this.term.rows);
});
// alert(JSON.stringify(winStyle));
this.$post('terminal/resize',winStyle).then(response => { this.$post('terminal/resize',winStyle).then(response => {
if (response.code === 200) { if (response.code === 200) {
this.term.fit(); this.term.fit();
@@ -335,6 +333,9 @@ export default {
this.$message.error(response.msg); this.$message.error(response.msg);
} }
}); });
});
// alert(JSON.stringify(winStyle));
// console.log(winStyle) // console.log(winStyle)
} }