This commit is contained in:
parent
164ac02b89
commit
200bdb8f23
5 changed files with 14 additions and 29 deletions
|
|
@ -245,6 +245,7 @@ export default {
|
|||
|
||||
manual: {
|
||||
title: 'Manual',
|
||||
usage: 'การใช้งาน',
|
||||
},
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -244,7 +244,8 @@ export default {
|
|||
},
|
||||
|
||||
manual: {
|
||||
title: 'คู่มือการใข้งาน',
|
||||
title: 'คู่มือ',
|
||||
usage: 'การใช้งาน',
|
||||
},
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -62,22 +62,6 @@ function branchSetting() {
|
|||
}
|
||||
|
||||
function initMenu() {
|
||||
// TODO: replace mock
|
||||
const test = [
|
||||
{
|
||||
label: 'หน้าแรก',
|
||||
labelEN: 'Home Page',
|
||||
category: 'jws',
|
||||
page: [
|
||||
{
|
||||
name: 'chapter-01-main',
|
||||
label: 'หลัก',
|
||||
labelEN: 'Main',
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
menuData.value = [
|
||||
{
|
||||
label: 'menu.manage',
|
||||
|
|
@ -176,11 +160,12 @@ function initMenu() {
|
|||
{
|
||||
label: 'menu.manual',
|
||||
icon: 'mdi-book-open-variant-outline',
|
||||
children: test.map((m) => ({
|
||||
label: locale.value === 'eng' ? m.labelEN : m.label,
|
||||
route: `/manual/${m.category}`,
|
||||
noI18n: true,
|
||||
})),
|
||||
children: [
|
||||
{
|
||||
label: 'usage',
|
||||
route: `/manual`,
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,14 +1,13 @@
|
|||
<script setup lang="ts">
|
||||
// NOTE: Library
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { onMounted } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
|
||||
// NOTE: Components
|
||||
|
||||
// NOTE: Stores & Type
|
||||
|
||||
import { Manual } from 'src/stores/manual/types';
|
||||
import { useManualStore } from 'src/stores/manual';
|
||||
import { useNavigator } from 'src/stores/navigator';
|
||||
|
||||
|
|
@ -16,10 +15,9 @@ import { useNavigator } from 'src/stores/navigator';
|
|||
const manualStore = useManualStore();
|
||||
const navigatorStore = useNavigator();
|
||||
const { dataManual } = storeToRefs(manualStore);
|
||||
const selectedManual = ref<string>('');
|
||||
const router = useRouter();
|
||||
|
||||
async function fatchManual() {
|
||||
async function fetchManual() {
|
||||
const res = await manualStore.getManual();
|
||||
dataManual.value = res ? res : [];
|
||||
}
|
||||
|
|
@ -31,7 +29,7 @@ function navigateTo(path: string) {
|
|||
onMounted(async () => {
|
||||
navigatorStore.current.title = 'menu.manual.title';
|
||||
navigatorStore.current.path = [{ text: '' }];
|
||||
await fatchManual();
|
||||
await fetchManual();
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
@ -51,7 +49,7 @@ onMounted(async () => {
|
|||
clickable
|
||||
dense
|
||||
class="dot items-center rounded"
|
||||
@click="() => navigateTo(`${v.category}/${x.name}`)"
|
||||
@click="() => navigateTo(`/manual/${v.category}/${x.name}`)"
|
||||
>
|
||||
{{ x.label }}
|
||||
</q-item>
|
||||
|
|
|
|||
|
|
@ -146,7 +146,7 @@ const routes: RouteRecordRaw[] = [
|
|||
component: () => import('pages/00_notification/MainPage.vue'),
|
||||
},
|
||||
{
|
||||
path: '/manual/:category',
|
||||
path: '/manual',
|
||||
name: 'Manual',
|
||||
component: () => import('pages/00_manual/MainPage.vue'),
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue