fix:修改ternimal会显示不全的问题

This commit is contained in:
zhangyu
2020-06-29 12:37:46 +08:00
parent fd13b160d0
commit c3637fa9b6
2 changed files with 10 additions and 3 deletions

View File

@@ -7,8 +7,8 @@
} }
</style> </style>
<template> <template>
<div class="console" :id="'ternimalContainer'+idIndex"> <div class="console" :id="'ternimalContainer'+idIndex" v-scrollBar:xterm>
<div :id="'terminal'+idIndex" v-scrollBar:xterm></div> <div :id="'terminal'+idIndex" ></div>
</div> </div>
</template> </template>
<script> <script>
@@ -70,6 +70,8 @@ export default {
if(consoleWidth){//需要调整宽度??? if(consoleWidth){//需要调整宽度???
cols = consoleWidth/11;//目前字体一个字母宽11 cols = consoleWidth/11;//目前字体一个字母宽11
} }
//调整终端可视区域高度
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));
}, },
resizeServiceConsole(){ resizeServiceConsole(){
@@ -322,6 +324,11 @@ export default {
this.$message.error(response.msg); this.$message.error(response.msg);
} }
}); });
//调整终端可视区域高度
document.getElementsByClassName('xterm-screen')[this.idIndex].style.height=height+'px'
this.$nextTick(()=>{
this.term.resize(this.term.cols,this.term.rows);
})
// console.log(winStyle) // console.log(winStyle)
} }
}, },

View File

@@ -3,7 +3,7 @@
width: 100%; width: 100%;
left: 0; left: 0;
position: fixed; position: fixed;
bottom: 20px; bottom: 50px;
background: #fff; background: #fff;
z-index: 2000; z-index: 2000;
height: 300px; height: 300px;