feat: 添加注册人数分析,优化bbs聊天回车优化

This commit is contained in:
橙子
2024-08-10 13:03:29 +08:00
parent 1c7486a7bc
commit 24b011ef93
6 changed files with 141 additions and 11 deletions

View File

@@ -288,6 +288,20 @@ const onclickUserItem = (userInfo, itemType) => {
changeInputValue(value);
}
//输入框按键事件
const handleKeydownInput=()=>{
// 检查是否按下 Shift + Enter
if (event.key === 'Enter' && event.shiftKey) {
// 允许输入换行
return; // 让默认行为继续
}
// 如果只按下 Enter则阻止默认的提交行为比如在表单中
if (event.key === 'Enter') {
onclickSendMsg();
}
}
//点击发送按钮
const onclickSendMsg = () => {
if (currentInputValue.value == "") {
@@ -389,7 +403,7 @@ const getLastMessage = ((receiveId, itemType) => {
<template>
<div style="position: absolute; top: 0;left: 0;" v-show="isShowTipNumber>0">
<p>当前版本1.5.0</p>
<p>当前版本1.5.1</p>
<p>tip:官方学习交流群每次发送消息消耗 1 钱钱</p>
<p>tip:点击聊天窗口右上角X可退出</p>
<p>tip:多人同时在聊天室时左侧可显示其他成员</p>
@@ -553,7 +567,9 @@ const getLastMessage = ((receiveId, itemType) => {
</div> -->
<textarea class="bottom-input" v-model="currentInputValue" @input="updateInputValue"
@keyup.enter="onclickSendMsg()">
@keydown="handleKeydownInput"
>
</textarea>
<div class="bottom-send">