From 7c4025954a5e87d08c91b9714bb4e93b3a2ea1b4 Mon Sep 17 00:00:00 2001 From: gexinzhineng/gxzn27 <1348660141@qq.com> Date: Tue, 23 May 2023 13:31:34 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=80=E5=87=BA=E7=B3=BB=E7=BB=9F=E9=87=8D?= =?UTF-8?q?=E6=96=B0=E7=99=BB=E5=BD=95=E4=BC=9A=E5=BC=B9=E5=87=BA=E9=87=8D?= =?UTF-8?q?=E6=96=B0=E7=99=BB=E5=BD=95=E5=BC=B9=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layout/components/Message/src/Message.vue | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/layout/components/Message/src/Message.vue b/src/layout/components/Message/src/Message.vue index 4ac85860..f1bf53b6 100644 --- a/src/layout/components/Message/src/Message.vue +++ b/src/layout/components/Message/src/Message.vue @@ -27,16 +27,19 @@ const goMyList = () => { name: 'MyNotifyMessage' }) } - +let timer: any = 0 // ========== 初始化 ========= onMounted(() => { // 首次加载小红点 getUnreadCount() // 轮询刷新小红点 - setInterval(() => { + timer = setInterval(() => { getUnreadCount() }, 1000 * 60 * 2) }) +onUnmounted(() => { + clearInterval(timer) +})