refactor: show icon
Some checks failed
Spell Check / Spell Check with Typos (push) Failing after 7s

This commit is contained in:
Thanaphon Frappet 2025-03-18 09:43:04 +07:00
parent 0091cedb59
commit a0f1d4d88a
2 changed files with 30 additions and 14 deletions

View file

@ -11,6 +11,7 @@ import { useRouter } from 'vue-router';
import { useManualStore } from 'src/stores/manual';
import { useNavigator } from 'src/stores/navigator';
import Expansion from 'src/components/14_report/Expansion.vue';
import { Icon } from '@iconify/vue/dist/iconify.js';
// NOTE: Variable
const manualStore = useManualStore();
@ -39,22 +40,35 @@ onMounted(async () => {
class="column full-height no-wrap surface-1 rounded bordered overflow-hidden q-pa-sm"
>
<section class="scroll q-gutter-y-sm">
<Expansion v-for="v in dataManual">
<q-expansion-item v-for="v in dataManual" :content-inset-level="1">
<template #header>
{{ $i18n.locale === 'eng' ? v.labelEN : v.label }}
<div class="row items-center full-width">
<Icon
v-if="!!v.icon"
:icon="v.icon"
:color="'var(--brand-1)'"
class="q-mr-sm"
/>
{{ $i18n.locale === 'eng' ? v.labelEN : v.label }}
</div>
</template>
<template #main>
<q-item
v-for="x in v.page"
clickable
dense
class="dot items-center rounded"
@click="() => navigateTo(`/manual/${v.category}/${x.name}`)"
>
{{ $i18n.locale === 'eng' ? x.labelEN : x.label }}
</q-item>
</template>
</Expansion>
<q-item
v-for="x in v.page"
clickable
dense
class="dot items-center rounded"
@click="() => navigateTo(`/manual/${v.category}/${x.name}`)"
>
<Icon
v-if="!!x.icon"
:icon="x.icon"
width="16px"
:color="'var(--brand-1)'"
class="q-mr-sm"
/>
{{ $i18n.locale === 'eng' ? x.labelEN : x.label }}
</q-item>
</q-expansion-item>
</section>
</div>
</template>

View file

@ -2,6 +2,7 @@ export type Manual = {
label: string;
labelEN: string;
category: string;
icon?: string;
page: Page[];
};
@ -9,4 +10,5 @@ type Page = {
name: string;
label: string;
labelEN: string;
icon?: string;
};