邓洁 : 修改头像下拉框
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
<bell-socket/>
|
||||
</div>
|
||||
<div>
|
||||
<img :src="authStore.userinfo.avatar" alt="" @click="handleVisitedP">
|
||||
<img :src="authStore.userinfo.avatar" alt="" @click.stop="handleVisitedP">
|
||||
<div v-if="visitedP">
|
||||
<ul>
|
||||
<li @click="handleToAuth">个人中心</li>
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user