1
0
mirror of https://github.com/elk-zone/elk synced 2024-11-23 22:56:09 +09:00

fix: issue 1366 (#1382)

This commit is contained in:
Ayaka Rizumu 2023-01-22 17:57:30 +08:00 committed by GitHub
parent c35f8fdd33
commit 29e5d6ddf7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 5 deletions

View File

@ -1,11 +1,14 @@
<script setup lang="ts">
const props = defineProps<{
const props = withDefaults(defineProps<{
is?: string
text?: string
description?: string
icon?: string
checked?: boolean
command?: boolean
}>()
}>(), {
is: 'div',
})
const emit = defineEmits(['click'])
const { hide } = useDropdownContext() || {}
@ -39,8 +42,10 @@ useCommand({
</script>
<template>
<div
v-bind="$attrs" ref="el"
<component
v-bind="$attrs"
:is="is"
ref="el"
flex gap-3 items-center cursor-pointer px4 py3
select-none
hover-bg-active
@ -67,5 +72,5 @@ useCommand({
<div v-if="checked" i-ri:check-line />
<slot name="actions" />
</div>
</component>
</template>

View File

@ -39,11 +39,13 @@ const clickUser = (user: UserLogin) => {
</template>
<div border="t base" pt2>
<CommonDropdownItem
is="button"
:text="$t('user.add_existing')"
icon="i-ri:user-add-line"
@click="openSigninDialog"
/>
<CommonDropdownItem
is="button"
v-if="isHydrated && currentUser"
:text="$t('user.sign_out_account', [getFullHandle(currentUser.account)])"
icon="i-ri:logout-box-line rtl-flip"