发送消息后重新获得输入框焦点

This commit is contained in:
TOP糯米 2023-03-27 21:57:04 +08:00
parent 99c8e04bb4
commit 9ae8088737
1 changed files with 4 additions and 0 deletions

View File

@ -13,6 +13,7 @@
class="inp"
type="text"
v-model="words"
ref="wordsInput"
:disabled="!canUse"
@keyup.enter="send"
@input="scrollToBottom"
@ -86,6 +87,9 @@ export default {
} else {
lastMessage.content = "[网络错误]";
}
this.$nextTick(() => {
this.$refs.wordsInput.focus();
});
this.scrollToBottom();
});
},