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,16 +325,17 @@ 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);
this.$post('terminal/resize',winStyle).then(response => {
if (response.code === 200) {
this.term.fit();
//this.term.scrollToBottom();
} else {
this.$message.error(response.msg);
}
});
}); });
// alert(JSON.stringify(winStyle)); // alert(JSON.stringify(winStyle));
this.$post('terminal/resize',winStyle).then(response => {
if (response.code === 200) {
this.term.fit();
//this.term.scrollToBottom();
} else {
this.$message.error(response.msg);
}
});
// console.log(winStyle) // console.log(winStyle)
} }