48 lines
1.2 KiB
Vue
48 lines
1.2 KiB
Vue
<template>
|
|
<UApp>
|
|
<NuxtLayout>
|
|
<NuxtPage />
|
|
</NuxtLayout>
|
|
<ConfirmModal />
|
|
</UApp>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import { onMounted, watch } from "vue";
|
|
import { useHead } from "#imports";
|
|
import { composSystemTheme } from "~/composables/composSystemTheme";
|
|
import { getUserPermission } from "~/stores/permissionStore";
|
|
|
|
const userPermissionStore = getUserPermission();
|
|
const systemTheme = composSystemTheme();
|
|
const { applyTheme, logo, currentTheme, isRtl } = systemTheme;
|
|
|
|
// تنظیم اولیه در کلاینت
|
|
onMounted(async () => {
|
|
await applyTheme();
|
|
userPermissionStore.fetchUserPermissions();
|
|
});
|
|
|
|
// بهروزرسانی واکنشگرای عنوان و هدر
|
|
watch(
|
|
[logo, currentTheme, isRtl],
|
|
([newLogo, newTheme, currentRtl]) => {
|
|
useHead({
|
|
title: `${newTheme?.title || "سامانه"} - ${newTheme?.subTitle || "مدیریت"}`,
|
|
htmlAttrs: {
|
|
dir: currentRtl ? "rtl" : "ltr",
|
|
lang: currentRtl ? "fa" : "en",
|
|
},
|
|
link: [
|
|
{
|
|
rel: "icon",
|
|
type: "image/x-icon",
|
|
href: newLogo || "/favicon.ico",
|
|
},
|
|
],
|
|
});
|
|
},
|
|
{ immediate: true }
|
|
);
|
|
</script>
|