feat: fetch option

This commit is contained in:
puriphatt 2024-06-18 11:47:03 +00:00
parent e07f764bf6
commit 536a5626be

View file

@ -18,6 +18,7 @@ import CanvasComponent from 'components/CanvasComponent.vue';
import ProfileMenu from 'components/ProfileMenu.vue';
import useUserStore from 'src/stores/user';
import FormDialog from 'src/components/FormDialog.vue';
import useOptionStore from 'src/stores/options';
import { Option } from 'src/stores/user/types';
import { dialog } from 'src/stores/utils';
import { setLocale } from 'src/utils/datetime';
@ -37,6 +38,7 @@ interface Notification {
const $q = useQuasar();
const loaderStore = useLoader();
const optionStore = useOptionStore();
const { visible } = storeToRefs(loaderStore);
const { locale } = useI18n({ useScope: 'global' });
@ -140,6 +142,9 @@ onMounted(async () => {
setLocale('th');
}
const resultOption = await fetch('/option/option.json');
optionStore.globalOption = await resultOption.json();
const user = getUsername();
const uid = getUserId();
@ -350,7 +355,7 @@ onMounted(async () => {
v-model:modal="canvasModal"
:title="$t('addSignature')"
no-app-box
:max-width="80"
max-width="80%"
>
<CanvasComponent ref="canvasRef" v-model:modal="canvasModal" />
<template #footer>