mirror of
https://github.com/elk-zone/elk.git
synced 2024-11-12 20:09:59 +00:00
feat(command): add description for settings items
This commit is contained in:
parent
fd93462f42
commit
40481c91e8
2 changed files with 9 additions and 11 deletions
|
@ -1,6 +1,7 @@
|
|||
<script lang="ts" setup>
|
||||
const props = defineProps<{
|
||||
text?: string
|
||||
description?: string
|
||||
icon?: string
|
||||
to: string | Record<string, string>
|
||||
command?: boolean
|
||||
|
@ -12,6 +13,7 @@ useCommand({
|
|||
scope: 'Settings',
|
||||
|
||||
name: () => props.text ?? (typeof props.to === 'string' ? props.to as string : props.to.name),
|
||||
description: () => props.description,
|
||||
icon: () => props.icon || '',
|
||||
visible: () => props.command,
|
||||
|
||||
|
@ -49,7 +51,9 @@ useCommand({
|
|||
</slot>
|
||||
</p>
|
||||
<p v-if="$slots.description" text-sm text-secondary>
|
||||
<slot name="description" />
|
||||
<slot name="description">
|
||||
{{ description }}
|
||||
</slot>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -10,21 +10,15 @@
|
|||
command
|
||||
icon="i-ri:user-settings-line"
|
||||
:text="$t('settings.profile.appearance.label')"
|
||||
:description="$t('settings.profile.appearance.description')"
|
||||
to="/settings/profile/appearance"
|
||||
>
|
||||
<template #description>
|
||||
{{ $t('settings.profile.appearance.description') }}
|
||||
</template>
|
||||
</SettingsNavItem>
|
||||
/>
|
||||
<SettingsNavItem
|
||||
command
|
||||
icon="i-ri:hashtag"
|
||||
:text="$t('settings.profile.featured_tags.label')"
|
||||
:description="$t('settings.profile.featured_tags.description')"
|
||||
to="/settings/profile/featured-tags"
|
||||
>
|
||||
<template #description>
|
||||
{{ $t('settings.profile.featured_tags.description') }}
|
||||
</template>
|
||||
</SettingsNavItem>
|
||||
/>
|
||||
</MainContent>
|
||||
</template>
|
||||
|
|
Loading…
Reference in a new issue