feat: เพิ่ม i18n
This commit is contained in:
parent
848ca9b447
commit
1f50ed36f3
1 changed files with 38 additions and 21 deletions
|
|
@ -1,34 +1,50 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref } from 'vue';
|
import { ref, watch } from 'vue';
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
|
import { useI18n } from 'vue-i18n';
|
||||||
|
|
||||||
|
const { t, locale } = useI18n();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
const currentRoute = ref<string>('');
|
const currentRoute = ref<string>('');
|
||||||
const labelMenu: {
|
|
||||||
label: string;
|
const labelMenu = ref<{ label: string; icon: string; route: string }[]>([
|
||||||
icon: string;
|
|
||||||
route: string;
|
|
||||||
}[] = [
|
|
||||||
{ label: 'Dashboard', icon: 'img:/file-account-outline.png', route: '' },
|
|
||||||
{
|
{
|
||||||
label: 'จัดการสาขา',
|
label: 'drawerDashboard',
|
||||||
|
icon: 'img:/file-account-outline.png',
|
||||||
|
route: '',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'drawerBranchManagement',
|
||||||
icon: 'mdi-sitemap-outline',
|
icon: 'mdi-sitemap-outline',
|
||||||
route: '/branch-management',
|
route: '/branch-management',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'จัดการบุคลากร',
|
label: 'drawerPersonnelManagement',
|
||||||
icon: 'mdi-account-settings-outline',
|
icon: 'mdi:account-settings-outline',
|
||||||
route: '/personnel-management',
|
route: '/personnel-management',
|
||||||
},
|
},
|
||||||
{ label: 'จัดการลูกค้า', icon: 'mdi-account-settings-outline', route: '' },
|
{
|
||||||
{ label: 'สินค้าและบริการ', icon: 'mdi-package-variant', route: '' },
|
label: 'drawerCustomerManagement',
|
||||||
{ label: 'ใบเสนอราคา', icon: 'mdi-package-variant', route: '' },
|
icon: 'mdi-account-settings-outline',
|
||||||
{ label: 'รายการคำขอ', icon: 'mdi-package-variant', route: '' },
|
route: '',
|
||||||
{ label: 'ใบสั่งงาน', icon: 'mdi-package-variant', route: '' },
|
},
|
||||||
{ label: 'ใบรับสินค้า', icon: 'mdi-package-variant', route: '' },
|
{
|
||||||
{ label: 'รายการทางบัญชี', icon: 'mdi-account-cash-outline', route: '' },
|
label: 'drawerProductsAndServices',
|
||||||
{ label: 'รายงาน', icon: 'mdi-file-chart-outline', route: '' },
|
icon: 'raphael:package',
|
||||||
];
|
route: '',
|
||||||
|
},
|
||||||
|
{ label: 'drawerQuotation', icon: 'raphael:package', route: '' },
|
||||||
|
{ label: 'drawerRequestList', icon: 'raphael:package', route: '' },
|
||||||
|
{ label: 'drawerWorkOrder', icon: 'raphael:package', route: '' },
|
||||||
|
{ label: 'drawerInvoice', icon: 'raphael:package', route: '' },
|
||||||
|
{
|
||||||
|
label: 'drawerAccountingLedger',
|
||||||
|
icon: 'mdi-account-cash-outline',
|
||||||
|
route: '',
|
||||||
|
},
|
||||||
|
{ label: 'drawerReport', icon: 'mdi-file-chart-outline', route: '' },
|
||||||
|
]);
|
||||||
|
|
||||||
const leftDrawerOpen = defineModel<boolean>('leftDrawerOpen', {
|
const leftDrawerOpen = defineModel<boolean>('leftDrawerOpen', {
|
||||||
default: false,
|
default: false,
|
||||||
|
|
@ -70,9 +86,10 @@ function navigateTo(label: string, destination: string) {
|
||||||
<q-item-section id="btn-drawer-back ">
|
<q-item-section id="btn-drawer-back ">
|
||||||
<q-item-label class="q-pl-lg">
|
<q-item-label class="q-pl-lg">
|
||||||
<div class="box-border-left" />
|
<div class="box-border-left" />
|
||||||
<q-icon :name="v.icon" size="sm" class="q-mr-xs" />
|
<iconify-icon :icon="v.icon" />
|
||||||
|
<!-- <q-icon :name="v.icon" size="sm" class="q-mr-xs" /> -->
|
||||||
|
|
||||||
{{ v.label }}
|
{{ $t(v.label) }}
|
||||||
</q-item-label>
|
</q-item-label>
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
</q-item>
|
</q-item>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue