chore: clean
Some checks failed
Spell Check / Spell Check with Typos (push) Failing after 10s

This commit is contained in:
Methapon2001 2025-03-18 09:14:55 +07:00
parent 164ac02b89
commit 200bdb8f23
5 changed files with 14 additions and 29 deletions

View file

@ -245,6 +245,7 @@ export default {
manual: { manual: {
title: 'Manual', title: 'Manual',
usage: 'การใช้งาน',
}, },
}, },

View file

@ -244,7 +244,8 @@ export default {
}, },
manual: { manual: {
title: 'คู่มือการใข้งาน', title: 'คู่มือ',
usage: 'การใช้งาน',
}, },
}, },

View file

@ -62,22 +62,6 @@ function branchSetting() {
} }
function initMenu() { function initMenu() {
// TODO: replace mock
const test = [
{
label: 'หน้าแรก',
labelEN: 'Home Page',
category: 'jws',
page: [
{
name: 'chapter-01-main',
label: 'หลัก',
labelEN: 'Main',
},
],
},
];
menuData.value = [ menuData.value = [
{ {
label: 'menu.manage', label: 'menu.manage',
@ -176,11 +160,12 @@ function initMenu() {
{ {
label: 'menu.manual', label: 'menu.manual',
icon: 'mdi-book-open-variant-outline', icon: 'mdi-book-open-variant-outline',
children: test.map((m) => ({ children: [
label: locale.value === 'eng' ? m.labelEN : m.label, {
route: `/manual/${m.category}`, label: 'usage',
noI18n: true, route: `/manual`,
})), },
],
}, },
]; ];
} }

View file

@ -1,14 +1,13 @@
<script setup lang="ts"> <script setup lang="ts">
// NOTE: Library // NOTE: Library
import { storeToRefs } from 'pinia'; import { storeToRefs } from 'pinia';
import { onMounted, ref } from 'vue'; import { onMounted } from 'vue';
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
// NOTE: Components // NOTE: Components
// NOTE: Stores & Type // NOTE: Stores & Type
import { Manual } from 'src/stores/manual/types';
import { useManualStore } from 'src/stores/manual'; import { useManualStore } from 'src/stores/manual';
import { useNavigator } from 'src/stores/navigator'; import { useNavigator } from 'src/stores/navigator';
@ -16,10 +15,9 @@ import { useNavigator } from 'src/stores/navigator';
const manualStore = useManualStore(); const manualStore = useManualStore();
const navigatorStore = useNavigator(); const navigatorStore = useNavigator();
const { dataManual } = storeToRefs(manualStore); const { dataManual } = storeToRefs(manualStore);
const selectedManual = ref<string>('');
const router = useRouter(); const router = useRouter();
async function fatchManual() { async function fetchManual() {
const res = await manualStore.getManual(); const res = await manualStore.getManual();
dataManual.value = res ? res : []; dataManual.value = res ? res : [];
} }
@ -31,7 +29,7 @@ function navigateTo(path: string) {
onMounted(async () => { onMounted(async () => {
navigatorStore.current.title = 'menu.manual.title'; navigatorStore.current.title = 'menu.manual.title';
navigatorStore.current.path = [{ text: '' }]; navigatorStore.current.path = [{ text: '' }];
await fatchManual(); await fetchManual();
}); });
</script> </script>
@ -51,7 +49,7 @@ onMounted(async () => {
clickable clickable
dense dense
class="dot items-center rounded" class="dot items-center rounded"
@click="() => navigateTo(`${v.category}/${x.name}`)" @click="() => navigateTo(`/manual/${v.category}/${x.name}`)"
> >
{{ x.label }} {{ x.label }}
</q-item> </q-item>

View file

@ -146,7 +146,7 @@ const routes: RouteRecordRaw[] = [
component: () => import('pages/00_notification/MainPage.vue'), component: () => import('pages/00_notification/MainPage.vue'),
}, },
{ {
path: '/manual/:category', path: '/manual',
name: 'Manual', name: 'Manual',
component: () => import('pages/00_manual/MainPage.vue'), component: () => import('pages/00_manual/MainPage.vue'),
}, },