From 2e7a17eeaec34f7df8eade15bcb36095e43c9d75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=8A=B2=E6=9D=BE?= Date: Mon, 26 Oct 2020 10:11:32 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=B5=8F=E8=A7=88?= =?UTF-8?q?=E5=99=A8resize=E6=97=B6terminal=E6=8A=A5=E9=94=99=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nezha-fronted/src/components/cli/console.vue | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/nezha-fronted/src/components/cli/console.vue b/nezha-fronted/src/components/cli/console.vue index 9df5f5955..6be2ef277 100644 --- a/nezha-fronted/src/components/cli/console.vue +++ b/nezha-fronted/src/components/cli/console.vue @@ -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) }