From 4aeed9292be182f0c064059bb2f31deea2ef1946 Mon Sep 17 00:00:00 2001 From: lifizer <913626195@qq.com> Date: Wed, 16 Jul 2025 10:07:39 +0800 Subject: [PATCH] =?UTF-8?q?Fix(=E8=AF=84=E8=AE=BA):=E8=8B=B9=E6=9E=9C13=20?= =?UTF-8?q?=2015=20=20=2016=EF=BC=8C=E7=82=B9=E5=87=BB=E5=9B=9E=E5=A4=8D?= =?UTF-8?q?=E7=9A=84=E6=97=B6=E5=80=99=E5=85=89=E6=A0=87=E6=98=AF=E5=81=9C?= =?UTF-8?q?=E7=95=99=E5=9C=A8@=E7=AC=A6=E5=8F=B7=E5=90=8E=E9=9D=A2?= =?UTF-8?q?=EF=BC=8C=E8=A6=81=E5=86=8D=E7=82=B9=E5=87=BB=E4=B8=80=E6=AC=A1?= =?UTF-8?q?=E5=85=89=E6=A0=87=E6=89=8D=E4=BC=9A=E5=81=9C=E7=95=99=E5=88=B0?= =?UTF-8?q?=E6=95=B4=E4=B8=AA=E6=98=B5=E7=A7=B0=E5=90=8E=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg_common/views/message.vue | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/pkg_common/views/message.vue b/pkg_common/views/message.vue index cb6a732..f756d20 100644 --- a/pkg_common/views/message.vue +++ b/pkg_common/views/message.vue @@ -183,14 +183,16 @@ export default { showSendBtn(item) { // 显示发送按钮 this.showBtn = true - // 延迟100ms,否则无法聚焦 - setTimeout(() => { - // 自动聚焦 - this.autoFocus = true - this.currentComment = item - this.content = '@' + item.senderUserNickname + ' ' - this.cursorIndex = this.content.length - }, 100) + this.currentComment = item + this.content = '@' + item.senderUserNickname + ' ' + this.$nextTick(() => { + // 延迟100ms,否则无法聚焦 + setTimeout(() => { + // 自动聚焦 + this.autoFocus = true + this.cursorIndex = this.content.length + }, 100) + }) }, /** * 失焦