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 { useManualStore } from 'src/stores/manual';
import { useNavigator } from 'src/stores/navigator'; import { useNavigator } from 'src/stores/navigator';
import Expansion from 'src/components/14_report/Expansion.vue'; import Expansion from 'src/components/14_report/Expansion.vue';
import { Icon } from '@iconify/vue/dist/iconify.js';
// NOTE: Variable // NOTE: Variable
const manualStore = useManualStore(); const manualStore = useManualStore();
@ -39,11 +40,18 @@ onMounted(async () => {
class="column full-height no-wrap surface-1 rounded bordered overflow-hidden q-pa-sm" class="column full-height no-wrap surface-1 rounded bordered overflow-hidden q-pa-sm"
> >
<section class="scroll q-gutter-y-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> <template #header>
<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 }} {{ $i18n.locale === 'eng' ? v.labelEN : v.label }}
</div>
</template> </template>
<template #main>
<q-item <q-item
v-for="x in v.page" v-for="x in v.page"
clickable clickable
@ -51,10 +59,16 @@ onMounted(async () => {
class="dot items-center rounded" class="dot items-center rounded"
@click="() => navigateTo(`/manual/${v.category}/${x.name}`)" @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 }} {{ $i18n.locale === 'eng' ? x.labelEN : x.label }}
</q-item> </q-item>
</template> </q-expansion-item>
</Expansion>
</section> </section>
</div> </div>
</template> </template>

View file

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