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 }