fix: tapping on avatar should show switcher on mobile
This commit is contained in:
parent
9687330dd4
commit
834eca2ad2
|
@ -24,7 +24,7 @@ const nav = ref<HTMLDivElement>()
|
|||
</div>
|
||||
<div flex items-center>
|
||||
<slot name="actions" />
|
||||
<NavUser v-if="isSmallScreen" :nav="nav" />
|
||||
<NavUser v-if="isSmallScreen" />
|
||||
</div>
|
||||
</div>
|
||||
<slot name="header" />
|
||||
|
|
|
@ -4,16 +4,7 @@ import type { ComponentPublicInstance } from 'vue'
|
|||
const avatar = ref<ComponentPublicInstance>()
|
||||
const switcher = ref()
|
||||
|
||||
const router = useRouter()
|
||||
|
||||
const goProfile = () => {
|
||||
router.push(`/@${currentUser.value!.account.username}`)
|
||||
}
|
||||
|
||||
let showSwitcher = $ref(false)
|
||||
onLongPress(avatar, () => {
|
||||
showSwitcher = true
|
||||
})
|
||||
|
||||
onClickOutside(avatar, () => {
|
||||
showSwitcher = false
|
||||
|
@ -26,6 +17,7 @@ onClickOutside(avatar, () => {
|
|||
v-model:shown="showSwitcher"
|
||||
:triggers="[]"
|
||||
:auto-hide="false"
|
||||
@click="showSwitcher = true"
|
||||
>
|
||||
<div style="-webkit-touch-callout: none;">
|
||||
<AccountAvatar
|
||||
|
@ -33,7 +25,6 @@ onClickOutside(avatar, () => {
|
|||
:account="currentUser.account"
|
||||
h="2em"
|
||||
:draggable="false"
|
||||
@click.stop="goProfile"
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
|
Loading…
Reference in a new issue