Files
front_base_nuxt/app/app.vue
T
2026-11-04 16:40:55 +03:30

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>