fixed bug for ctrl + enter key start a new row

This commit is contained in:
RockYang
2023-04-23 15:00:51 +08:00
parent 646c39792b
commit d2201596f6
3 changed files with 51 additions and 18 deletions

View File

@@ -114,6 +114,8 @@
</el-icon>
</el-tooltip>
<span class="text">Ctrl + Enter 换行</span>
</el-row>
<div class="input-box">
@@ -457,6 +459,11 @@ export default defineComponent({
inputKeyDown: function (e) {
if (e.keyCode === 13) {
if (e.ctrlKey) { // Ctrl + Enter 换行
this.inputValue += "\n";
return;
}
if (this.sending) {
ElMessage.warning("AI 正在作答中,请稍后...");
e.preventDefault();
@@ -812,6 +819,11 @@ export default defineComponent({
background-color #232425
cursor pointer
}
.text {
margin-left 10px;
font-size 12px;
color #9f9f9f;
}
}
.input-box {