1
0

fix: user switcher blocking other dialog (#430)

This commit is contained in:
Ayaka Rizumu 2022-12-15 21:50:11 +08:00 committed by GitHub
parent ebf1bb81b0
commit 61113a242a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 5 deletions

View File

@ -9,8 +9,8 @@
/> />
</div> </div>
<template #popper> <template #popper="{ hide }">
<UserSwitcher ref="switcher" /> <UserSwitcher ref="switcher" @click="hide()" />
</template> </template>
</VDropdown> </VDropdown>
<button v-else btn-solid text-sm px-2 py-1 text-center @click="openSigninDialog()"> <button v-else btn-solid text-sm px-2 py-1 text-center @click="openSigninDialog()">

View File

@ -1,6 +1,10 @@
<script setup lang="ts"> <script setup lang="ts">
import type { UserLogin } from '~/types' import type { UserLogin } from '~/types'
const emits = defineEmits<{
(event: 'click'): void
}>()
const all = useUsers() const all = useUsers()
const sorted = computed(() => { const sorted = computed(() => {
@ -20,7 +24,7 @@ const switchUser = (user: UserLogin) => {
</script> </script>
<template> <template>
<div sm:min-w-80 max-w-100vw mxa py2 flex="~ col"> <div sm:min-w-80 max-w-100vw mxa py2 flex="~ col" @click="emits('click')">
<template v-for="user of sorted" :key="user.id"> <template v-for="user of sorted" :key="user.id">
<button <button
flex rounded px4 py3 text-left flex rounded px4 py3 text-left

View File

@ -38,8 +38,8 @@
<button btn-action-icon :aria-label="$t('action.switch_account')"> <button btn-action-icon :aria-label="$t('action.switch_account')">
<div i-ri:more-2-line /> <div i-ri:more-2-line />
</button> </button>
<template #popper> <template #popper="{ hide }">
<UserSwitcher /> <UserSwitcher @click="hide" />
</template> </template>
</VDropdown> </VDropdown>
</div> </div>