1
0
Fork 1
mirror of https://github.com/elk-zone/elk.git synced 2024-07-09 07:46:48 +01: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"> <script setup lang="ts">
const props = defineProps<{ const props = withDefaults(defineProps<{
is?: string
text?: string text?: string
description?: string description?: string
icon?: string icon?: string
checked?: boolean checked?: boolean
command?: boolean command?: boolean
}>() }>(), {
is: 'div',
})
const emit = defineEmits(['click']) const emit = defineEmits(['click'])
const { hide } = useDropdownContext() || {} const { hide } = useDropdownContext() || {}
@ -39,8 +42,10 @@ useCommand({
</script> </script>
<template> <template>
<div <component
v-bind="$attrs" ref="el" v-bind="$attrs"
:is="is"
ref="el"
flex gap-3 items-center cursor-pointer px4 py3 flex gap-3 items-center cursor-pointer px4 py3
select-none select-none
hover-bg-active hover-bg-active
@ -67,5 +72,5 @@ useCommand({
<div v-if="checked" i-ri:check-line /> <div v-if="checked" i-ri:check-line />
<slot name="actions" /> <slot name="actions" />
</div> </component>
</template> </template>

View file

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