fix: 修复浏览器resize时terminal报错的问题
This commit is contained in:
@@ -58,7 +58,7 @@ export default {
|
||||
},
|
||||
resize(consoleHeigt,consoleWidth){
|
||||
this.resizeConsole(consoleHeigt,consoleWidth);
|
||||
this.resizeServiceConsole();
|
||||
this.resizeServiceConsole(consoleHeigt);
|
||||
},
|
||||
resizeConsole(consoleHeigt,consoleWidth){
|
||||
//调整终端容器高度
|
||||
@@ -325,16 +325,17 @@ export default {
|
||||
document.getElementsByClassName('xterm-screen')[this.idIndex].style.height=height+'px'
|
||||
this.$nextTick(()=>{
|
||||
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));
|
||||
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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user