From 05aed8f816991bdcc86e4a954dc3af79bc367c8a Mon Sep 17 00:00:00 2001 From: bob <312777916@qq.com> Date: Sun, 19 Jan 2025 12:05:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B6=88=E6=81=AF=E6=A1=86=E6=A6=82=E7=8E=87?= =?UTF-8?q?=E6=80=A7=E4=B8=8D=E8=83=BD=E8=A7=A6=E5=BA=95=EF=BC=8C=E7=94=A8?= =?UTF-8?q?setTimeout=E5=90=8E=E8=A7=82=E5=AF=9F=E6=95=88=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/message/MessageLayout.vue | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/views/message/MessageLayout.vue b/src/views/message/MessageLayout.vue index ab7911d..84f7f46 100644 --- a/src/views/message/MessageLayout.vue +++ b/src/views/message/MessageLayout.vue @@ -588,14 +588,13 @@ const onLoadMore = async () => { * @param behavior smooth 平滑的, instant 立即 */ const msgListReachBottom = async (behavior = 'smooth') => { - await nextTick() // 经测试,在未读消息的session页面刷新时,不能到达底部,需要再加一个nextTick - nextTick(() => { + setTimeout(() => { msgListDiv.value?.scrollTo({ top: msgListDiv.value.scrollHeight, behavior: behavior }) newMsgTips.value.isShowBottomTips = false - }) + }, 0) } const onReturnBottom = () => {