From 5556372e1e81d2d0881780f09620e083c4c6f375 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=93=E6=B4=81?= <209192278@qq.com> Date: Sat, 11 Nov 2023 18:16:08 +0800 Subject: [PATCH] =?UTF-8?q?=E9=82=93=E6=B4=81=20:=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=A4=B4=E5=83=8F=E4=B8=8B=E6=8B=89=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layout/navbar/index.vue | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/layout/navbar/index.vue b/src/layout/navbar/index.vue index 7456d61..42f1242 100644 --- a/src/layout/navbar/index.vue +++ b/src/layout/navbar/index.vue @@ -7,7 +7,7 @@
- +
  • 个人中心
  • @@ -29,7 +29,15 @@ import BellSocket from "./BellSocket.vue"; const authStore = useAuthStore() const visitedP = ref(false) const router = useRouter() - +onMounted(() => { + document.addEventListener('click', nullBlockClick) +}) +onBeforeUnmount(() => { + document.removeEventListener('click', nullBlockClick) +}) +const nullBlockClick = () => { + visitedP.value = false +} const handleVisitedP = () => { visitedP.value = !visitedP.value }