feat(command): add description for settings items

This commit is contained in:
三咲智子 2022-12-30 04:01:31 +08:00
parent fd93462f42
commit 40481c91e8
No known key found for this signature in database
GPG key ID: 69992F2250DFD93E
2 changed files with 9 additions and 11 deletions

View file

@ -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>

View file

@ -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>