From 536a5626becdfadb28c622604e30c7e0590773da Mon Sep 17 00:00:00 2001 From: puriphatt Date: Tue, 18 Jun 2024 11:47:03 +0000 Subject: [PATCH] feat: fetch option --- src/layouts/MainLayout.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/layouts/MainLayout.vue b/src/layouts/MainLayout.vue index 95d48556..682840df 100644 --- a/src/layouts/MainLayout.vue +++ b/src/layouts/MainLayout.vue @@ -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%" >