fix: user switcher blocking other dialog (#430)

zio/stable
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>
<template #popper>
<UserSwitcher ref="switcher" />
<template #popper="{ hide }">
<UserSwitcher ref="switcher" @click="hide()" />
</template>
</VDropdown>
<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">
import type { UserLogin } from '~/types'
const emits = defineEmits<{
(event: 'click'): void
}>()
const all = useUsers()
const sorted = computed(() => {
@ -20,7 +24,7 @@ const switchUser = (user: UserLogin) => {
</script>
<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">
<button
flex rounded px4 py3 text-left

View File

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