Skip to content

Commit f09ccc9

Browse files
committed
fix test
1 parent 3fb5039 commit f09ccc9

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-web-terminal",
3-
"version": "2.3.3-rc.1",
3+
"version": "2.3.3",
44
"description": "A beautiful web-side command line window plugin (native simulation). 一个漂亮的网页命令行插件(原生模拟)",
55
"license": "Apache-2.0",
66
"private": false,

src/Terminal.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ export default {
121121
},
122122
selectedIndex: 0
123123
},
124-
autoScrollToBottom: true
124+
forceScrollToBottom: true
125125
}
126126
},
127127
props: terminalProps(),
@@ -293,7 +293,7 @@ export default {
293293
let doc = e.target
294294
let bottom = doc.scrollHeight - doc.clientHeight - doc.scrollTop
295295

296-
this.autoScrollToBottom = bottom <= 30;
296+
this.forceScrollToBottom = bottom <= 100;
297297
})
298298

299299
// 如果是移动设备,需要监听touch事件来模拟双击事件
@@ -1021,22 +1021,23 @@ export default {
10211021
* @private
10221022
*/
10231023
_pushMessage(message) {
1024+
let forceToBottom = this.forceScrollToBottom
10241025
if (!message) return
10251026
if (message instanceof Array) {
10261027
for (let m of message) {
10271028
this._pushMessage0(m, false)
10281029
}
10291030
this._checkLogSize()
1030-
this._jumpToBottom()
1031+
this._jumpToBottom(forceToBottom)
10311032
return;
10321033
}
10331034

10341035
this._pushMessage0(message)
1035-
this._jumpToBottom()
1036+
this._jumpToBottom(forceToBottom)
10361037

10371038
if (message.type === MESSAGE_TYPE.JSON) {
10381039
setTimeout(() => {
1039-
this._jumpToBottom()
1040+
this._jumpToBottom(forceToBottom)
10401041
}, 80)
10411042
}
10421043
},
@@ -1131,7 +1132,7 @@ export default {
11311132
}
11321133
},
11331134
_jumpToBottom(force = false) {
1134-
if (!force && !this.autoScrollToBottom) {
1135+
if (!force && !this.forceScrollToBottom) {
11351136
return
11361137
}
11371138
this.$nextTick(() => {
@@ -1354,6 +1355,7 @@ export default {
13541355
}
13551356

13561357
})
1358+
this._jumpToBottom(true)
13571359
}, 100),
13581360
_checkInputCursor() {
13591361
let eIn = this.$refs.terminalCmdInputRef

src/css/theme/light.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
--t-cmd-help-background-color: white;
1919
--t-cmd-help-code-background-color: #f7f7f9;
2020
--t-cmd-help-box-shadow: 0px 0px 0px 4px rgb(0 0 0 / 20%);
21-
--t-text-editor-floor-background-color: rgba(0,0,0,.1);
21+
--t-text-editor-floor-background-color: white;
2222
--t-text-editor-floor-close-btn-color: #9a7070;
2323
--t-text-editor-floor-save-btn-color: #00b10e;
2424
--t-text-editor-floor-btn-hover-color: #652222;

0 commit comments

Comments
 (0)